diff options
author | Doug McIlroy <doug@cs.dartmouth.edu> | 2014-10-19 22:57:53 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2014-10-19 22:59:53 +0200 |
commit | 1b5af3cc0b05ac1c64814f31af44f4429c87e41d (patch) | |
tree | 8e51ca7daf3705183e3dbf5b5f9eeba3a5d6ab8a | |
parent | e5ab613ed052900138e489207a2d60f482969aa3 (diff) | |
download | groff-git-1b5af3cc0b05ac1c64814f31af44f4429c87e41d.tar.gz |
Fix Savannah bug #42151.
* src/preproc/eqn/lex.cpp (file_input::read_line): Handle CR/LF.
* src/preproc/pic/pic.cpp (file_input::read_line): Ditto.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/preproc/eqn/lex.cpp | 5 | ||||
-rw-r--r-- | src/preproc/pic/lex.cpp | 5 |
3 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,10 @@ +2014-10-19 Doug McIlroy <doug@cs.dartmouth.edu> + + Fix Savannah bug #42151. + + * src/preproc/eqn/lex.cpp (file_input::read_line): Handle CR/LF. + * src/preproc/pic/pic.cpp (file_input::read_line): Ditto. + 2014-10-18 Werner LEMBERG <wl@gnu.org> [mdoc] Add Darwin version string for OS X 10.10. diff --git a/src/preproc/eqn/lex.cpp b/src/preproc/eqn/lex.cpp index 9f9913286..b6f15bd2f 100644 --- a/src/preproc/eqn/lex.cpp +++ b/src/preproc/eqn/lex.cpp @@ -413,6 +413,11 @@ int file_input::read_line() lineno++; for (;;) { int c = getc(fp); + if (c == '\r') { + c = getc(fp); + if (c != '\n') + lex_error("invalid input character code %1", '\r'); + } if (c == EOF) break; else if (invalid_input_char(c)) diff --git a/src/preproc/pic/lex.cpp b/src/preproc/pic/lex.cpp index f7f868de6..2ebd28a9c 100644 --- a/src/preproc/pic/lex.cpp +++ b/src/preproc/pic/lex.cpp @@ -90,6 +90,11 @@ int file_input::read_line() lineno++; for (;;) { int c = getc(fp); + if (c == '\r') { + c = getc(fp); + if (c != '\n') + lex_error("invalid input character code %1", '\r'); + } if (c == EOF) break; else if (invalid_input_char(c)) |