From 8ce5bc05bcf9b263a65eb6e8d6bae0e610a88b16 Mon Sep 17 00:00:00 2001 From: tjg Date: Mon, 1 Oct 2001 12:54:26 +0000 Subject: Bug: it's no longer possible to use parentheses to sneak a word that needs quoting past the "quoting detector", so `fn x { echo $(x.y) }' now works both in the current rc and its descendants. --- parse.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index b1bcf85..f83e673 100644 --- a/parse.y +++ b/parse.y @@ -124,7 +124,7 @@ first : comword | first '^' sword { $$ = mk(nConcat,$1,$3); } sword : comword - | keyword { $$ = mk(nWord,$1, NULL); } + | keyword { $$ = mk(nWord, $1, NULL, FALSE); } word : sword | word '^' sword { $$ = mk(nConcat,$1,$3); } @@ -139,7 +139,7 @@ comword : '$' sword { $$ = mk(nVar,$2); } | BACKBACK word sword { $$ = mk(nBackq,$2,$3); } | '(' nlwords ')' { $$ = $2; } | REDIR brace { $$ = mk(nNmpipe,$1.type,$1.fd,$2); } - | WORD { $$ = ($1.w[0] == '\'') ? mk(nQword, $1.w+1, NULL) : mk(nWord,$1.w, $1.m); } + | WORD { $$ = mk(nWord, $1.w, $1.m, $1.q); } keyword : FOR { $$ = "for"; } | IN { $$ = "in"; } @@ -166,7 +166,7 @@ optnl : /* empty */ %% void initparse() { - star = treecpy(mk(nVar,mk(nWord,"*",NULL)), ealloc); - nolist = treecpy(mk(nVar,mk(nWord,"ifs",NULL)), ealloc); + star = treecpy(mk(nVar, mk(nWord,"*", NULL, FALSE)), ealloc); + nolist = treecpy(mk(nVar, mk(nWord,"ifs", NULL, FALSE)), ealloc); } -- cgit v1.2.3