cmd: mkdir: Set errorlevel on invalid argument.

This commit is contained in:
Dan Kegel 2011-08-02 12:21:31 -07:00 committed by Alexandre Julliard
parent 15ce9a5784
commit 3cd864bdf8
3 changed files with 9 additions and 8 deletions

View file

@ -537,6 +537,7 @@ void WCMD_create_dir (WCHAR *command) {
if (!argN) break;
if (!create_full_path(thisArg)) {
WCMD_print_error ();
errorlevel = 1;
}
}
}

View file

@ -485,18 +485,18 @@ if exist foo (rmdir foo & echo dir created
echo %ErrorLevel%
rem Invalid chars
mkdir ?
echo %ErrorLevel%
echo mkdir ? gives errorlevel %ErrorLevel%
call :setError 0
mkdir ?\foo
echo %ErrorLevel%
echo mkdir ?\foo gives errorlevel %ErrorLevel%
call :setError 0
mkdir foo\?
echo %ErrorLevel%
echo mkdir foo\? gives errorlevel %ErrorLevel%
if exist foo (rmdir foo & echo ok, foo created
) else ( echo foo not created )
call :setError 0
mkdir foo\bar\?
echo %ErrorLevel%
echo mkdir foo\bar\? gives errorlevel %ErrorLevel%
call :setError 0
if not exist foo (
echo bad, foo not created

View file

@ -277,11 +277,11 @@ del /q * succeeded on file2.dat
0
dir created
0
@todo_wine@1
@todo_wine@1
@todo_wine@1
mkdir ? gives errorlevel 1
mkdir ?\foo gives errorlevel 1
mkdir foo\? gives errorlevel 1
@todo_wine@ok, foo created
@todo_wine@1
mkdir foo\bar\? gives errorlevel 1
@todo_wine@ok, foo\bar created
foo created
bar created