aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-02-24 22:08:45 +0200
committerArnold D. Robbins <arnold@skeeve.com>2015-02-24 22:08:45 +0200
commitefefbfe40342975cc0ddbd69a9b0f2635d905d3c (patch)
treed90f5fc95e6702dadf4cfad6b6f8ec5d592331f3 /awkgram.c
parent764317bf85e5e63651486933b880a4627529d967 (diff)
downloadegawk-efefbfe40342975cc0ddbd69a9b0f2635d905d3c.tar.gz
egawk-efefbfe40342975cc0ddbd69a9b0f2635d905d3c.tar.bz2
egawk-efefbfe40342975cc0ddbd69a9b0f2635d905d3c.zip
Fix line continuation with CR-LF.
Diffstat (limited to 'awkgram.c')
-rw-r--r--awkgram.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/awkgram.c b/awkgram.c
index b3283eb2..5376d010 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -5400,7 +5400,10 @@ yylex(void)
pushback();
yyerror(_("unterminated regexp ends with `\\' at end of file"));
goto end_regexp; /* kludge */
- } else if (c == '\n') {
+ }
+ if (c == '\r') /* allow MS-DOS files. bleah */
+ c = nextc(true);
+ if (c == '\n') {
sourceline++;
continue;
} else {
@@ -5731,6 +5734,8 @@ retry:
if ((gawk_mb_cur_max == 1 || nextc_is_1stbyte) &&
c == '\\') {
c = nextc(true);
+ if (c == '\r') /* allow MS-DOS files. bleah */
+ c = nextc(true);
if (c == '\n') {
sourceline++;
continue;