I noticed a fencepost error in the preprocessor.  We should be
checking if the next char is at the limit, not the current char (which
can't be, because we're looking at it).

        libcpp/
        * lex.c (_cpp_clean_line): Fix DOS off-by-one error.

pushing to trunk
--
Nathan Sidwell
diff --git i/libcpp/lex.c w/libcpp/lex.c
index fb222924c8c..1d522030a3c 100644
--- i/libcpp/lex.c
+++ w/libcpp/lex.c
@@ -1062,7 +1062,7 @@ _cpp_clean_line (cpp_reader *pfile)
       d = (uchar *) s;
 
       /* Handle DOS line endings.  */
-      if (*s == '\r' && s != buffer->rlimit && s[1] == '\n')
+      if (*s == '\r' && s + 1 != buffer->rlimit && s[1] == '\n')
 	s++;
     }
 

Reply via email to