mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Handle trailing whitespace in .netrc. Published in
<sxsitkofbfw.fsf@florida.arsdigita.de>.
This commit is contained in:
parent
cee04f2ef3
commit
1810f7a442
@ -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>
|
2001-04-02 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||||
|
|
||||||
* init.c (cmd_address): Heap-allocate the address that gets stored
|
* init.c (cmd_address): Heap-allocate the address that gets stored
|
||||||
|
12
src/netrc.c
12
src/netrc.c
@ -269,13 +269,6 @@ parse_netrc (const char *path)
|
|||||||
/* While there are lines in the file... */
|
/* While there are lines in the file... */
|
||||||
while ((line = read_whole_line (fp)))
|
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 ++;
|
ln ++;
|
||||||
|
|
||||||
/* Parse the line. */
|
/* Parse the line. */
|
||||||
@ -294,8 +287,9 @@ parse_netrc (const char *path)
|
|||||||
while (*p && ISSPACE (*p))
|
while (*p && ISSPACE (*p))
|
||||||
p ++;
|
p ++;
|
||||||
|
|
||||||
/* Discard end-of-line comments. */
|
/* Discard end-of-line comments; also, stop processing if
|
||||||
if (*p == '#')
|
the above `while' merely skipped trailing whitespace. */
|
||||||
|
if (*p == '#' || !*p)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* If the token starts with quotation mark, note this fact,
|
/* If the token starts with quotation mark, note this fact,
|
||||||
|
Loading…
Reference in New Issue
Block a user