We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent daa4c4a commit 1f32390Copy full SHA for 1f32390
simplecpp.cpp
@@ -251,17 +251,15 @@ class simplecpp::TokenList::Stream {
251
// Handling of newlines..
252
if (ch == '\r') {
253
ch = '\n';
254
- if (bom == 0 && static_cast<char>(peek()) == '\n')
255
- (void)get();
256
- else if (isUtf16) {
257
- const int c1 = get();
+
+ int ch2 = get();
+ if (isUtf16) {
258
const int c2 = get();
259
- const int ch16 = makeUtf16Char(c1, c2);
260
- if (ch16 != '\n') {
261
- unget();
262
263
- }
+ ch2 = makeUtf16Char(ch2, c2);
264
}
+ if (ch2 != '\n')
+ ungetChar();
265
266
267
return ch;
0 commit comments