From 518fe8d06d01b194989637ca3c74863633db256e Mon Sep 17 00:00:00 2001 From: hniksic Date: Wed, 29 Nov 2000 08:19:46 -0800 Subject: [PATCH] [svn] Do away with line separator. --- src/ChangeLog | 4 ++++ src/netrc.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 6ce845de..324f0b75 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2000-11-29 John Summerfield + + * netrc.c (parse_netrc): Get rid of line ending. + 2000-11-25 Hrvoje Niksic * ftp.c (ftp_retrieve_list): Undo typo "fix" until resolution by 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. */ -- 2.39.2