summaryrefslogtreecommitdiff
path: root/lex.c
diff options
context:
space:
mode:
authortjg <tjg>2001-10-02 13:00:35 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:19 +0100
commita11a8d312e531231ed4d284f3cd129ccf2de2a43 (patch)
treec007353858e83d5056bf06632a1a2de09a97fdcb /lex.c
parent38da49b97b529815045c23cfef4820a56179eebb (diff)
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.
Diffstat (limited to 'lex.c')
-rw-r--r--lex.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lex.c b/lex.c
index 45b6ddb..291b747 100644
--- a/lex.c
+++ b/lex.c
@@ -70,11 +70,13 @@ enum filedescriptors {
};
/* does this string require quoting? */
-extern bool quotep(char *s) {
+extern bool quotep(char *s, bool dollar) {
unsigned char c;
+ const char *meta;
+ meta = dollar ? dnw : nw;
while ((c = *s++))
- if (nw[c])
+ if (meta[c])
return TRUE;
return FALSE;
}