]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
faxmail: Fix broken to address/name parsing
authorAidan Van Dyk <aidan@ifax.com>
Thu, 29 Oct 2009 14:52:26 +0000 (10:52 -0400)
committerAidan Van Dyk <aidan@ifax.com>
Thu, 29 Oct 2009 14:56:30 +0000 (10:56 -0400)
faxmail/faxmail.c++

index 8a7ced42569120460aac1294d693b52b21a9662c..653058bcd16f9bb7fe39c638685987bc42eddfe7 100644 (file)
@@ -347,12 +347,17 @@ faxMailApp::run(int argc, char** argv)
            to.remove(0, to.skip(0, " \t"));
            to.resize(to.skipR(to.length(), " \t"));
 
-           //remove matched quoting characters, recursively
-           //If they don't match, we'll assume they are part of
-           //the larger string, and not "quoting" marks
-           for (;;)
+           /*
+            * Remove matched quoting characters, recursively
+            * If they don't match, we'll assume they are part of
+            * the larger string, and not "quoting" marks
+            * The string to must have at least 2 chars for us to
+            * have anything to work on.
+            */
+           for (;to.length() > 1;)
            {
                int i;
+               /* We have 3 sets of quoting chars to look for */
                const char* remove[] = { "\"\"", "''","()" };
                for (i = 0; i < 3; i++)
                    if (to[0] == remove[i][0] &&