X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fnetrc.c;h=ac4393ccb21b03556f329cde89ee0f7f2223dd22;hb=518fe8d06d01b194989637ca3c74863633db256e;hp=4177b7304ae08833697da223263d2b98a6d12023;hpb=7e900c50bf3ad4a1e31be307375085db4dadbcb6;p=wget diff --git a/src/netrc.c b/src/netrc.c index 4177b730..ac4393cc 100644 --- a/src/netrc.c +++ b/src/netrc.c @@ -270,6 +270,13 @@ 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. */