projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
ignore trailing carriage returns in file parser
[project/uci.git]
/
file.c
diff --git
a/file.c
b/file.c
index
c2b0e72
..
c69a297
100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-60,7
+60,10
@@
__private void uci_getln(struct uci_context *ctx, int offset)
ofs += strlen(p);
if (pctx->buf[ofs - 1] == '\n') {
pctx->line++;
- pctx->buf[ofs - 1] = 0;
+ if (ofs >= 2 && pctx->buf[ofs - 2] == '\r')
+ pctx->buf[ofs - 2] = 0;
+ else
+ pctx->buf[ofs - 1] = 0;
return;
}