From c8d07027c89d36a5a3981196a19d48a9286127a8 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 19 Dec 2010 17:42:09 +0000 Subject: 28537: fix word splitting on "((" when it was nested subshells rather than arithmetic --- ChangeLog | 8 +++++++- Src/lex.c | 5 +++++ Test/D04parameter.ztst | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4c899ac60..6ba2f041b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-12-19 Peter Stephenson + + * 28537: Src/lex.c, Test/D04parameter.ztst: word splitting on + '((' in command position that turned into nested subshell + commands was broken. + 2010-12-18 Barton E. Schaefer * 27862 (belatedly): Completion/X/Utility/_x_arguments: handle @@ -13997,5 +14003,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5159 $ +* $Revision: 1.5160 $ ***************************************************** diff --git a/Src/lex.c b/Src/lex.c index 3d70c5bbf..2988b41cb 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -885,6 +885,11 @@ gettok(void) return DINPAR; case 0: + /* + * Not math, so we don't return the contents + * as a string in this case. + */ + tokstr = NULL; return INPAR; default: diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index 8ce68c317..8ba08b29c 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -393,6 +393,7 @@ 'foo=(1 2 3)' '(( 3 + 1 == 8 / 2 ))' 'for (( i = 1 ; i < 10 ; i++ ))' + '((0.25542 * 60) - 15)*60' ) for string in $strings; do array=(${(z)string}) @@ -416,6 +417,19 @@ >4:i < 10 ;: >5:i++ : >6:)): +# This one needs resolving between a math expression and +# a command, which causes interesting effects internally. +>1:(: +>2:(: +>3:0.25542: +>4:*: +>5:60: +>6:): +>7:-: +>8:15: +>9:): +>10:*60: + line=$'A line with # someone\'s comment\nanother line # (1 more\nanother one' print "*** Normal ***" -- cgit 1.4.1