]> Pileus Git - ~andy/fetchmail/commitdiff
Better backslash handling in RFC822 strings.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 6 Jul 2001 01:19:16 +0000 (01:19 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 6 Jul 2001 01:19:16 +0000 (01:19 -0000)
svn path=/trunk/; revision=3397

NEWS
rfc822.c

diff --git a/NEWS b/NEWS
index 5fd06fadcb6efc64e4e95f62755f6c08594743eb..b3045c595d043c47b379b28c26860f3e04933d70 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@
 * Don't depend on having snprintf available.
 * Bug fix for envskip.
 * ODMR finally seems to be working.
+* Handle multiple backslashes within RFC822 address strings correctly.
 
 fetchmail-5.8.11 (Sun Jul  1 21:39:26 EDT 2001), 20973 lines:
 
index 909b1b7b93f8c0e202eb04b0c0b1af719f206b3c..5f8e21b756cb712c23e100e54e2c41a5e4931c99 100644 (file)
--- a/rfc822.c
+++ b/rfc822.c
@@ -145,7 +145,16 @@ const unsigned char *host; /* server hostname */
 
            case 2:     /* we're in a string */
                if (*from == '"')
-                   state = 1;
+               {
+                   char        *bp;
+                   int         bscount;
+
+                   bscount = 0;
+                   for (bp = from - 1; *bp == '\\'; bp--)
+                       bscount++;
+                   if (bscount % 2)
+                       state = 1;
+               }
                break;
 
            case 3:     /* we're in a <>-enclosed address */