diff --git a/src/conf.c b/src/conf.c index 052b20f9..a61a3591 100644 --- a/src/conf.c +++ b/src/conf.c @@ -301,6 +301,8 @@ static char *readline(FILE * fp, char **buf, size_t *buflen) size = newsize; } else { *newline = '\0'; /* kill newline */ + if(newline > p && newline[-1] == '\r') /* and carriage return if necessary */ + newline[-1] = '\0'; break; /* yay */ } }