projects
/
platform
/
upstream
/
orc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87441e1
)
orcparse: handle win32 \r\n line endings
author
Tim-Philipp Müller
<tim@centricular.com>
Fri, 22 May 2015 12:57:30 +0000
(13:57 +0100)
committer
Tim-Philipp Müller
<tim@centricular.com>
Fri, 22 May 2015 13:18:21 +0000
(14:18 +0100)
orc/orcparse.c
patch
|
blob
|
history
diff --git
a/orc/orcparse.c
b/orc/orcparse.c
index
4be32b5
..
f4d0a28
100644
(file)
--- a/
orc/orcparse.c
+++ b/
orc/orcparse.c
@@
-452,6
+452,10
@@
orc_parse_get_line (OrcParser *parser)
memcpy (parser->line, parser->p, n);
parser->line[n] = 0;
+ /* windows text files might have \r\n as line ending */
+ if (n > 0 && parser->line[n - 1] == '\r')
+ parser->line[n - 1] = 0;
+
parser->p = end;
if (parser->p[0] == '\n') {
parser->p++;