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
7e471514
Commit
7e471514
authored
Aug 24, 2023
by
Dmitry Sokolov
Committed by
Alexandre Julliard
Aug 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Fixed var substring in 'enableDelayedExpansion' mode.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55402
parent
bd102523
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
test_builtins.cmd
programs/cmd/tests/test_builtins.cmd
+11
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+5
-0
wcmdmain.c
programs/cmd/wcmdmain.c
+1
-1
No files found.
programs/cmd/tests/test_builtins.cmd
View file @
7e471514
...
...
@@ -1275,6 +1275,17 @@ set x=C:\Program Files (x86)
if ""=="" set y=%x%\dummy
echo %y%
echo --- Testing if + var subst in delayed expansion mode
setlocal enableDelayedExpansion
for %%i in (abc 10.0 11.0) do (
set result=%%i
echo [DEBUG] checking {!result!}
if "!result:~0,3!"=="10." (
echo SDKVER=!result!
)
)
endlocal
echo ------------ Testing for ------------
echo --- plain FOR
for %%i in (A B C) do echo %%i
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
7e471514
...
...
@@ -927,6 +927,11 @@ x@space@
A
------------ Testing if/set ------------
C:\Program Files (x86)\dummy
--- Testing if + var subst in delayed expansion mode
[DEBUG] checking {abc}
[DEBUG] checking {10.0}
SDKVER=10.0
[DEBUG] checking {11.0}
------------ Testing for ------------
--- plain FOR
A
...
...
programs/cmd/wcmdmain.c
View file @
7e471514
...
...
@@ -596,7 +596,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR startchar)
/* If there's complex substitution, just need %var% for now
to get the expanded data to play with */
if
(
colonpos
)
{
*
colonpos
=
startchar
;
*
colonpos
=
'%'
;
savedchar
=
*
(
colonpos
+
1
);
*
(
colonpos
+
1
)
=
0x00
;
}
...
...
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