projects
/
oweals
/
tinc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Allow reading config files with CRLF endings on Unix systems.
[oweals/tinc.git]
/
src
/
conf.c
diff --git
a/src/conf.c
b/src/conf.c
index 052b20f9e7aae6a9209200de05a863306f3169cf..a61a3591b8ba592c74bc63a22a6d3e92ff99a0b3 100644
(file)
--- 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 */
}
}