Allow reading config files with CRLF endings on Unix systems.
This commit is contained in:
parent
d1910ac198
commit
0966cca8ab
1 changed files with 2 additions and 0 deletions
|
@ -301,6 +301,8 @@ static char *readline(FILE * fp, char **buf, size_t *buflen)
|
||||||
size = newsize;
|
size = newsize;
|
||||||
} else {
|
} else {
|
||||||
*newline = '\0'; /* kill newline */
|
*newline = '\0'; /* kill newline */
|
||||||
|
if(newline > p && newline[-1] == '\r') /* and carriage return if necessary */
|
||||||
|
newline[-1] = '\0';
|
||||||
break; /* yay */
|
break; /* yay */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue