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)
/* After this, we need full information on the file,
which is valid not to exist. */
if (!skipFileParsing) {
if (GetFullPathNameW(outputparam, MAX_PATH, fullfilename, NULL) == 0)
return;
exists = GetFileAttributesExW(fullfilename, GetFileExInfoStandard,
&fileInfo);
if (GetFullPathNameW(outputparam, MAX_PATH, fullfilename, NULL) == 0) {
exists = FALSE;
fullfilename[0] = 0x00;
} else {
exists = GetFileAttributesExW(fullfilename, GetFileExInfoStandard,
&fileInfo);
}
/* 2. Handle 'a' : Output attributes (File doesn't have to exist) */
if (memchrW(firstModifier, 'a', modifierLen) != NULL) {
......
......@@ -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 %%~dsi
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
for %%i in ("A B" C) do call :echoFun %%i
......
......@@ -319,6 +319,7 @@ N
@drive@
''
'.eh'
',,,,,,,,,'
--- in parameters
"A B"
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