Commit 7e471514 authored by Dmitry Sokolov's avatar Dmitry Sokolov Committed by Alexandre Julliard

cmd: Fixed var substring in 'enableDelayedExpansion' mode.

parent bd102523
......@@ -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
......
......@@ -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
......
......@@ -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;
}
......
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