psss / rpms / ksh

Forked from rpms/ksh 6 years ago
Clone
04e570f
--- ksh_20120801/src/cmd/ksh93/sh/lex.c	2012-06-12 21:05:18.000000000 +0200
04e570f
+++ ksh_20120801/src/cmd/ksh93/sh/lex.c	2015-08-18 17:42:06.138076565 +0200
04e570f
@@ -1603,7 +1603,14 @@ static int comsub(register Lex_t *lp, in
04e570f
 				if(n==4)
04e570f
 					break;
04e570f
 				if(sh_lexstates[ST_NAME][c])
04e570f
+				{
04e570f
+					if(c==' ' || c=='\t')
04e570f
+					{
04e570f
+						n = 0;
04e570f
+						continue;
04e570f
+					}
04e570f
 					goto skip;
04e570f
+				}
04e570f
 				word[n++] = c;
04e570f
 			}
04e570f
 			if(sh_lexstates[ST_NAME][c]==S_BREAK)
04e570f
--- ksh_20120801/src/cmd/ksh93/tests/subshell.sh	2012-07-25 23:40:29.000000000 +0200
04e570f
+++ ksh_20120801/src/cmd/ksh93/tests/subshell.sh	2015-08-18 17:42:06.143076553 +0200
04e570f
@@ -617,4 +617,6 @@ do	if	[[ -e $f ]]
04e570f
 	fi
04e570f
 done
04e570f
 
04e570f
+$SHELL > /dev/null -c 'echo $(for x in whatever; do case y in *) true;; esac; done)' || err_exit 'syntax error with case in command substitution'
04e570f
+
04e570f
 exit $((Errors<125?Errors:125))