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