diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-22 10:35:59 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-22 10:35:59 +0200 |
commit | c1d5be099ecd2a0d4e120360bae24582723f1153 (patch) | |
tree | 19a59c6ea56d7031bf6d89ae6f3a77e934a91555 /butl/char-scanner.cxx | |
parent | 5a36f357e174d002722122d2408c57fb43da6e59 (diff) |
Handle Windows CR/LF style line-ending in char_scanner
Diffstat (limited to 'butl/char-scanner.cxx')
-rw-r--r-- | butl/char-scanner.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/butl/char-scanner.cxx b/butl/char-scanner.cxx index a54c20d..b923aa6 100644 --- a/butl/char-scanner.cxx +++ b/butl/char-scanner.cxx @@ -53,6 +53,17 @@ namespace butl { is_.get (); + if (crlf_ && c == 0x0D) + { + xchar c1 (peek ()); + + if (c1 == '\n') + { + is_.get (); + c = c1; + } + } + if (c == '\n') { line++; |