From: Ken Hornstein Date: Wed, 5 Mar 2014 20:11:54 +0000 (-0500) Subject: Switch over to using the token parser instead of isspace(), and X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/ea61b6fbcec3d7109dcbd8c74848d1a4aff1fe57?ds=inline;hp=f46f2bf428ce57460760544c7acf1f81194cdc63 Switch over to using the token parser instead of isspace(), and make sure we have our pointer correct when doing an encoded parameter that isn't the first one. --- diff --git a/uip/mhparse.c b/uip/mhparse.c index 42312120..0d8bf41f 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -3403,6 +3403,8 @@ parse_header_attrs (const char *filename, const char *fieldname, free(charset); return NOTOK; } + + dp = vp; } /* @@ -3412,8 +3414,7 @@ parse_header_attrs (const char *filename, const char *fieldname, * length so we can allocate the correct buffer size. */ - for (dp = vp, len = 0; *vp != '\0' && !isspace((unsigned char) *vp); - vp++) { + for (len = 0; istoken(*vp); vp++) { if (*vp == '%') { if (*(vp + 1) == '\0' || !isxdigit((unsigned char) *(vp + 1)) || @@ -3437,7 +3438,7 @@ parse_header_attrs (const char *filename, const char *fieldname, up = valptr = mh_xmalloc(len + 1); - for (vp = dp; *vp != '\0' && !isspace((unsigned char) *vp); vp++) { + for (vp = dp; istoken(*vp); vp++) { if (*vp == '%') { *up++ = decode_qp(*(vp + 1), *(vp + 2)); vp += 2;