From efefbfe40342975cc0ddbd69a9b0f2635d905d3c Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Feb 2015 22:08:45 +0200 Subject: Fix line continuation with CR-LF. --- awkgram.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'awkgram.c') 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; -- cgit v1.2.3