Commit 546819b1 authored by Andreas Schuh's avatar Andreas Schuh Committed by GitHub

Merge pull request #152 from Liuchang0812/master

fix: Consider Windows-style LRLF in flag parsing
parents ac1a925c 0c17f1ee
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment