-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
- --
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI 48104
http://linuxbox.com
tel. 734-761-4689
fax. 734-769-8938
cel. 734-216-5309
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJLYaAJiSUUSaRdSURCNBMAJ90xJm8VjlLJuubuxqi2drt8plR7QCdHXDs
zBhdg5Gf8JScY8BdXqMZf8I=
=Kd5i
-----END PGP SIGNATURE-----
--- HttpHeaderTools.c.orig 2008-11-07 17:00:20.000000000 -0500
+++ HttpHeaderTools.c 2008-11-07 17:52:14.000000000 -0500
@@ -246,6 +246,7 @@
" ?,\t\r\n"
};
int quoted = 0;
+
delim[0][1] = del;
delim[2][1] = del;
assert(str && item && pos);
@@ -258,6 +259,7 @@
*pos += strspn(*pos, delim[2]);
*item = *pos; /* remember item's start */
+
/* find next delimiter */
do {
*pos += strcspn(*pos, delim[quoted]);
@@ -265,13 +267,15 @@
break;
if (**pos == '"') {
quoted = !quoted;
- *pos += 1;
+ goto advance;
}
if (quoted && **pos == '\\') {
*pos += 1;
- if (**pos)
- *pos += 1;
+ goto advance;
}
+ advance:
+ if (**pos)
+ (*pos)++;
} while (**pos);
len = *pos - *item; /* *pos points to del or '\0' */
/* rtrim */