commit | becba507595aaf6940af662c9096dbabe50baba4 | [log] [tgz] |
---|---|---|
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | Tue Apr 12 15:21:08 2016 +0900 |
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | Tue Apr 12 15:21:08 2016 +0900 |
tree | 58d9fdae2c26d82e04f3fcafc4358b99109f0e70 | |
parent | 706c27ff12c09b899dce19992feac315cae6073b [diff] [blame] |
[C++] Strip a trailing \r
diff --git a/parser.cc b/parser.cc index e88a9d9..e6c652a 100644 --- a/parser.cc +++ b/parser.cc
@@ -78,6 +78,8 @@ if (!fixed_lineno_) loc_.lineno++; StringPiece line(buf_.data() + l_, e - l_); + if (line.get(line.size() - 1) == '\r') + line.remove_suffix(1); orig_line_with_directives_ = line; ParseLine(line); if (!fixed_lineno_)