X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fhtml-url.c;h=218659d454d4a23b34c0288f1b848585a14b1e4b;hp=68a8bc3c7a132d8f56b540dff72235f39845a9b0;hb=5febddec7087446e0083d5e4455a9c06c391d760;hpb=bc7ea11d8eac6f2378731b98172d9f9facab3e78 diff --git a/src/html-url.c b/src/html-url.c index 68a8bc3c..218659d4 100644 --- a/src/html-url.c +++ b/src/html-url.c @@ -590,15 +590,25 @@ tag_handle_meta (int tagid, struct taginfo *tag, struct map_context *ctx) { while (*content) { - /* Find the next occurrence of ',' or the end of - the string. */ - char *end = strchr (content, ','); - if (end) - ++end; - else - end = content + strlen (content); + char *end; + /* Skip any initial whitespace. */ + content += strspn (content, " \f\n\r\t\v"); + /* Find the next occurrence of ',' or whitespace, + * or the end of the string. */ + end = content + strcspn (content, ", \f\n\r\t\v"); if (!strncasecmp (content, "nofollow", end - content)) ctx->nofollow = true; + /* Skip past the next comma, if any. */ + if (*end == ',') + ++end; + else + { + end = strchr (end, ','); + if (end) + ++end; + else + end = content + strlen (content); + } content = end; } }