mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-29 08:43:42 -04:00
Fix re-write of config file by preserving line endings
This commit is contained in:
parent
cab9a1ecd0
commit
839f500358
4
src/io.c
4
src/io.c
@ -913,8 +913,8 @@ int io_readline_timeout(IO_PRIVHANDLE *phandle, unsigned char *buf,
|
|||||||
if((!ascii) || (to_read != '\r')) {
|
if((!ascii) || (to_read != '\r')) {
|
||||||
numread += to_read;
|
numread += to_read;
|
||||||
if(buf[numread-1] == '\n') {
|
if(buf[numread-1] == '\n') {
|
||||||
buf[numread-1] = '\0';
|
buf[numread] = '\0'; /* retain the CR */
|
||||||
*len = numread;
|
*len = numread+1;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
if(!to_read) { /* EOF */
|
if(!to_read) { /* EOF */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user