Commit 32ea7d1f authored by Dan Kegel's avatar Dan Kegel Committed by Alexandre Julliard

cmd: WCMD_delete: fix /s for dirnames containing spaces, add test.

parent 2bd19a89
......@@ -106,6 +106,26 @@ for %%a in (1 2.dat) do if not exist file%%a echo del /q * succeeded on file%%a
cd ..
rmdir del_q_dir
echo ------------ Testing del /s --------------
mkdir "foo bar"
cd "foo bar"
echo hi > file1.dat
echo there > file2.dat
echo bub > file3.dat
echo bye > "file with spaces.dat"
cd ..
del /s file1.dat > nul
del file2.dat /s > nul
del "file3.dat" /s > nul
del "file with spaces.dat" /s > nul
cd "foo bar"
for %%f in (1 2 3) do if exist file%%f.dat echo Del /s failed on file%%f
for %%f in (1 2 3) do if exist file%%f.dat del file%%f.dat
if exist "file with spaces.dat" echo Del /s failed on "file with spaces.dat"
if exist "file with spaces.dat" del "file with spaces.dat"
cd ..
rmdir "foo bar"
echo -----------Testing Errorlevel-----------
rem nt 4.0 doesn't really support a way of setting errorlevel, so this is weak
rem See http://www.robvanderwoude.com/exit.php
......
......@@ -85,6 +85,7 @@ r.test not found after delete, good
------------ Testing del /q --------------
del /q * succeeded on file1
del /q * succeeded on file2.dat
------------ Testing del /s --------------
-----------Testing Errorlevel-----------
1
errorlevel just right, good
......
......@@ -57,7 +57,7 @@ void WCMD_clear_screen (void);
void WCMD_color (void);
void WCMD_copy (void);
void WCMD_create_dir (void);
BOOL WCMD_delete (WCHAR *, BOOL);
BOOL WCMD_delete (WCHAR *);
void WCMD_directory (WCHAR *);
void WCMD_echo (const WCHAR *);
void WCMD_endlocal (void);
......
......@@ -1447,7 +1447,7 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
break;
case WCMD_DEL:
case WCMD_ERASE:
WCMD_delete (p, TRUE);
WCMD_delete (p);
break;
case WCMD_DIR:
WCMD_directory (p);
......
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