Commit 2b9649d9 authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

cmd: Fix tilda parameter expansion when arg is empty.

parent dc4dd0cb
...@@ -514,11 +514,13 @@ void WCMD_HandleTildaModifiers(WCHAR **start, BOOL atExecute) ...@@ -514,11 +514,13 @@ void WCMD_HandleTildaModifiers(WCHAR **start, BOOL atExecute)
/* After this, we need full information on the file, /* After this, we need full information on the file,
which is valid not to exist. */ which is valid not to exist. */
if (!skipFileParsing) { if (!skipFileParsing) {
if (GetFullPathNameW(outputparam, MAX_PATH, fullfilename, NULL) == 0) if (GetFullPathNameW(outputparam, MAX_PATH, fullfilename, NULL) == 0) {
return; exists = FALSE;
fullfilename[0] = 0x00;
exists = GetFileAttributesExW(fullfilename, GetFileExInfoStandard, } else {
&fileInfo); exists = GetFileAttributesExW(fullfilename, GetFileExInfoStandard,
&fileInfo);
}
/* 2. Handle 'a' : Output attributes (File doesn't have to exist) */ /* 2. Handle 'a' : Output attributes (File doesn't have to exist) */
if (memchrW(firstModifier, 'a', modifierLen) != NULL) { if (memchrW(firstModifier, 'a', modifierLen) != NULL) {
......
...@@ -363,6 +363,7 @@ for %%i in ("d e" f) do echo %%~dpi ...@@ -363,6 +363,7 @@ for %%i in ("d e" f) do echo %%~dpi
for %%i in ("g h" i) do echo %%~sdi for %%i in ("g h" i) do echo %%~sdi
for %%i in ("g h" i) do echo %%~dsi for %%i in ("g h" i) do echo %%~dsi
for %%i in ("j k" l.eh) do echo '%%~xsi' for %%i in ("j k" l.eh) do echo '%%~xsi'
for %%i in ("") do echo '%%~i,%%~fi,%%~di,%%~pi,%%~ni,%%~xi,%%~si,%%~ai,%%~ti,%%~zi'
echo --- in parameters echo --- in parameters
for %%i in ("A B" C) do call :echoFun %%i for %%i in ("A B" C) do call :echoFun %%i
......
...@@ -319,6 +319,7 @@ N ...@@ -319,6 +319,7 @@ N
@drive@ @drive@
'' ''
'.eh' '.eh'
',,,,,,,,,'
--- in parameters --- in parameters
"A B" "A B"
C C
......
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