From a33d76f8c95d33d6590dd185a2200f06cef014c7 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 13 Sep 2018 11:54:20 +0200 Subject: [PATCH] ape/make: fix \ line continuation parsing --- sys/src/ape/cmd/make/gram.y | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/src/ape/cmd/make/gram.y b/sys/src/ape/cmd/make/gram.y index 73bf48f08..243a8f557 100644 --- a/sys/src/ape/cmd/make/gram.y +++ b/sys/src/ape/cmd/make/gram.y @@ -321,17 +321,17 @@ else { break; case '\n': - ++yylineno; - if(p==yytext || p[-1]!='\\') - { - *p = '\0'; - goto endloop; - } - p[-1] = ' '; - while( (kc=getc(fin))=='\t' || kc==' ' || kc=='\n') - if(kc == '\n') - ++yylineno; - + do { + ++yylineno; + if(p==yytext || p[-1]!='\\') + { + *p = '\0'; + goto endloop; + } + p[-1] = ' '; + while( (kc=getc(fin))=='\t' || kc==' ') + ; + } while(kc == '\n'); if(kc != EOF) break; case EOF: