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