diff options
-rw-r--r-- | libbutl/char-scanner.cxx | 9 | ||||
-rw-r--r-- | libbutl/char-scanner.mxx | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/libbutl/char-scanner.cxx b/libbutl/char-scanner.cxx index 607d887..cebad61 100644 --- a/libbutl/char-scanner.cxx +++ b/libbutl/char-scanner.cxx @@ -64,8 +64,13 @@ namespace butl eos_ = true; else if (crlf_ && v == '\r') { - get_ (); - int_type v1 (peek_ ()); + int_type v1; + do + { + get_ (); + v1 = peek_ (); + } + while (v1 == '\r'); if (v1 != '\n') { diff --git a/libbutl/char-scanner.mxx b/libbutl/char-scanner.mxx index 3947a05..7b5be9f 100644 --- a/libbutl/char-scanner.mxx +++ b/libbutl/char-scanner.mxx @@ -39,7 +39,8 @@ LIBBUTL_MODEXPORT namespace butl public: // If the crlf argument is true, then recognize Windows newlines (0x0D // 0x0A) and convert them to just '\n' (0x0A). Note that a standalone - // 0x0D is treated "as if" it was followed by 0x0A. + // 0x0D is treated "as if" it was followed by 0x0A and multiple 0x0D + // are treated as one. // // Note also that if the stream happens to be ifdstream, then it includes // a number of optimizations that assume nobody else is messing with the |