Commit f45f75ca authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

cmd: %* expands to first non-whitespace delimiter of first arg.

parent 4236c200
......@@ -251,6 +251,16 @@ call tell;1;;2
if errorlevel 2 echo error %ErrorLevel%
call tell "p "1 p" "2
call tell p"1 p";2
echo --------- Testing delimiters and parameter passing --------------
echo @echo 0:%%0,1:%%1,2:%%2,All:'%%*'> tell.bat
call;tell 1 2
call tell 1 2
==call==tell==1==2
call tell(1234)
call tell(12(34)
call tell(12;34)
echo --------- Finished --------------
del tell.bat say*.*
exit
:setError
......
......@@ -122,3 +122,11 @@ THIS FAILS: cmd ignoreme/c say one
1:1,2:2@space@
1:"p@space@"1,2:p"@space@"2@space@
1:p"1@space@p",2:2@space@
--------- Testing delimiters and parameter passing --------------
0:tell,1:1,2:2,All:'1 2'@or_broken@0:tell,1:1,2:2,All:' 1 2'
0:tell,1:1,2:2,All:'1 2'@or_broken@0:tell,1:1,2:2,All:' 1 2'
0:tell,1:1,2:2,All:'==1==2'
@todo_wine@0:tell,1:(1234),2:,All:'(1234)'
@todo_wine@0:tell,1:(12(34),2:,All:'(12(34)'
@todo_wine@0:tell,1:(12,2:34),All:'(12;34)'
@todo_wine@--------- Finished --------------
......@@ -843,10 +843,12 @@ static void handleExpansion(WCHAR *cmd, BOOL justFors,
/* Replace use of %* if in batch program*/
} else if (!justFors && context && *(p+1)=='*') {
WCHAR *startOfParms = NULL;
WCMD_parameter(context -> command, 1, &startOfParms, NULL, TRUE);
if (startOfParms != NULL)
WCMD_parameter(context -> command, 0, NULL, &startOfParms, TRUE);
if (startOfParms != NULL) {
startOfParms++; /* Skip to first delimiter then skip whitespace */
while (*startOfParms==' ' || *startOfParms == '\t') startOfParms++;
WCMD_strsubstW(p, p+2, startOfParms, -1);
else
} else
WCMD_strsubstW(p, p+2, NULL, 0);
} else if (forVariable &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment