Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f45f75ca
Commit
f45f75ca
authored
Oct 13, 2012
by
Jason Edmeades
Committed by
Alexandre Julliard
Oct 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: %* expands to first non-whitespace delimiter of first arg.
parent
4236c200
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
test_cmdline.cmd
programs/cmd/tests/test_cmdline.cmd
+10
-0
test_cmdline.cmd.exp
programs/cmd/tests/test_cmdline.cmd.exp
+8
-0
wcmdmain.c
programs/cmd/wcmdmain.c
+5
-3
No files found.
programs/cmd/tests/test_cmdline.cmd
View file @
f45f75ca
...
...
@@ -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
...
...
programs/cmd/tests/test_cmdline.cmd.exp
View file @
f45f75ca
...
...
@@ -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 --------------
programs/cmd/wcmdmain.c
View file @
f45f75ca
...
...
@@ -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
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment