]> sjero.net Git - wget/commitdiff
[svn] Handle trailing whitespace in .netrc. Published in
authorhniksic <devnull@localhost>
Sun, 1 Apr 2001 23:28:25 +0000 (16:28 -0700)
committerhniksic <devnull@localhost>
Sun, 1 Apr 2001 23:28:25 +0000 (16:28 -0700)
<sxsitkofbfw.fsf@florida.arsdigita.de>.

src/ChangeLog
src/netrc.c

index d7d60c6993990429b9011bcda444bcbaa1c58b1e..99709be50a55400d199f31e497812c39bdb04b83 100644 (file)
@@ -1,3 +1,18 @@
+2001-04-02  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * netrc.c (parse_netrc): Don't trim the line endings explicitly;
+       they will be handled as whitespace.
+       (parse_netrc): Correctly handle lines that end with whitespace.
+
+2001-04-02  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * retr.c (retrieve_url): New variable global_download_count used
+       to identify first retrieval.
+
+       * ftp.c (getftp): Ditto.
+
+       * http.c (gethttp): Rewind opt.dfp only on first retrieval.
+
 2001-04-02  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * init.c (cmd_address): Heap-allocate the address that gets stored
index 7f7601a24738326f2a917bebffeb3088ba5e1d63..9777e9e261a5d4eb5dc9e996e81dc661040c6089 100644 (file)
@@ -269,13 +269,6 @@ parse_netrc (const char *path)
   /* While there are lines in the file...  */
   while ((line = read_whole_line (fp)))
     {
-      /* Do away with line separators. */
-      int len = strlen (line);
-      if (len && line[len - 1] == '\n')
-       line[--len] = '\0';
-      if (len && line[len - 1] == '\r')
-       line[--len] = '\0';
-
       ln ++;
 
       /* Parse the line.  */
@@ -294,8 +287,9 @@ parse_netrc (const char *path)
          while (*p && ISSPACE (*p))
            p ++;
 
-         /* Discard end-of-line comments.  */
-         if (*p == '#')
+         /* Discard end-of-line comments; also, stop processing if
+            the above `while' merely skipped trailing whitespace.  */
+         if (*p == '#' || !*p)
            break;
 
          /* If the token starts with quotation mark, note this fact,