projects
/
platform
/
upstream
/
gflags.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac1a925
)
fix bug about LRLF
author
liuchang0812
<liuchang0812@gmail.com>
Tue, 28 Jun 2016 09:57:02 +0000
(17:57 +0800)
committer
liuchang0812
<liuchang0812@gmail.com>
Tue, 28 Jun 2016 09:57:02 +0000
(17:57 +0800)
src/gflags.cc
patch
|
blob
|
history
diff --git
a/src/gflags.cc
b/src/gflags.cc
index
c4a689d
..
a05d801
100644
(file)
--- a/
src/gflags.cc
+++ b/
src/gflags.cc
@@
-1278,7
+1278,11
@@
string CommandLineFlagParser::ProcessOptionsFromStringLocked(
for (; line_end; flagfile_contents = line_end + 1) {
while (*flagfile_contents && isspace(*flagfile_contents))
++flagfile_contents;
- line_end = strchr(flagfile_contents, '\n');
+ // Windows uses "\r\n"
+ line_end = strchr(flagfile_contents, '\r');
+ if (line_end == NULL)
+ line_end = strchr(flagfile_contents, '\n');
+
size_t len = line_end ? line_end - flagfile_contents
: strlen(flagfile_contents);
string line(flagfile_contents, len);