From 7cfd8be0dc83342b4a71f3a8e5b7efab4670e50c Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 25 Sep 2007 22:29:00 +0800 Subject: [EXPAND] Move parse-time quote flag detection to run-time Because the parser does not recursively parse parameter expansion with respect to quotes, we can't accurately determine quote status at parse time. This patch works around this by moving the quote detection to run-time where we do interpret it recursively. Test case: foo=\\ echo "<${foo#[\\]}>" Old result: <\> New result: <> --- src/expand.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/expand.h') diff --git a/src/expand.h b/src/expand.h index be7ec6f..4dfbc43 100644 --- a/src/expand.h +++ b/src/expand.h @@ -53,7 +53,7 @@ struct arglist { #define EXP_VARTILDE 0x4 /* expand tildes in an assignment */ #define EXP_REDIR 0x8 /* file glob for a redirection (1 match only) */ #define EXP_CASE 0x10 /* keeps quotes around for CASE pattern */ -#define EXP_RECORD 0x20 /* need to record arguments for ifs breakup */ +#define EXP_QPAT 0x20 /* pattern in quoted parameter expansion */ #define EXP_VARTILDE2 0x40 /* expand tildes after colons only */ #define EXP_WORD 0x80 /* expand word in parameter expansion */ #define EXP_QUOTED 0x100 /* expand word in double quotes */ -- cgit 1.4.1