projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d1910ac
)
Allow reading config files with CRLF endings on Unix systems.
author
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 20 Jan 2009 13:20:44 +0000
(14:20 +0100)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 20 Jan 2009 13:20:44 +0000
(14:20 +0100)
src/conf.c
patch
|
blob
|
history
diff --git
a/src/conf.c
b/src/conf.c
index
052b20f
..
a61a359
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 */
}
}