From: dan Date: Thu, 2 Mar 2000 21:28:59 +0000 (-0800) Subject: [svn] recur.c (parse_robots): Applied Edward J. Sabol's patch for Guan Yang's reported X-Git-Tag: v1.13~2506 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=03e5e4fe4d9eb84423e8ad8c73b18a8cf7b82535 [svn] recur.c (parse_robots): Applied Edward J. Sabol's patch for Guan Yang's reported problem with "User-agent:*" lines. --- diff --git a/src/recur.c b/src/recur.c index 8de38061..078f7d85 100644 --- a/src/recur.c +++ b/src/recur.c @@ -709,13 +709,13 @@ parse_robots (const char *robots_filename) *str++ = '\0'; /* Look for the string beginning... */ for (; *str && ISSPACE (*str); str++); - /* Look for comments and kill them off. */ + /* Look for comments or trailing spaces and kill them off. */ for (p = str; *p; p++) - if (*p && ISSPACE (*p) && *(p + 1) == '#') + if (*p && ISSPACE (*p) && ((*(p + 1) == '#') || (*(p + 1) == '\0'))) { - /* We have found a shell-style comment `+ #'. Now - rewind to the beginning of the spaces and place '\0' - there. */ + /* We have found either a shell-style comment `+#' or some + trailing spaces. Now rewind to the beginning of the spaces + and place '\0' there. */ while (p > str && ISSPACE (*p)) --p; if (p == str)