Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
16cb9c4c
Commit
16cb9c4c
authored
Nov 17, 2015
by
Hugh McMaster
Committed by
Alexandre Julliard
Nov 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: 'del' should set %errorlevel% to zero, not one, on error.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
66fc1319
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
builtins.c
programs/cmd/builtins.c
+1
-3
test_builtins.cmd
programs/cmd/tests/test_builtins.cmd
+22
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+6
-0
No files found.
programs/cmd/builtins.c
View file @
16cb9c4c
...
...
@@ -1410,10 +1410,8 @@ BOOL WCMD_delete (WCHAR *args) {
argsProcessed
=
TRUE
;
found
=
WCMD_delete_one
(
thisArg
);
if
(
!
found
)
{
errorlevel
=
1
;
if
(
!
found
)
WCMD_output_stderr
(
WCMD_LoadMessage
(
WCMD_FILENOTFOUND
),
thisArg
);
}
foundAny
|=
found
;
}
...
...
programs/cmd/tests/test_builtins.cmd
View file @
16cb9c4c
...
...
@@ -1493,6 +1493,28 @@ for /f "tokens=3,2,3*" %%i in ("a b c d e f g") do echo h=%%h i=%%i j=%%j k=%%k
cd ..
rd /s/q foobar
echo ------------ Testing del ------------
echo abc > file
echo deleting 'file'
del file
if errorlevel 0 (
echo errorlevel is 0, good
) else (
echo unexpected errorlevel, got %errorlevel%
)
if not exist file (
echo successfully deleted 'file'
) else (
echo error deleting 'file'
)
echo attempting to delete 'file', even though it is not present
del file
if errorlevel 0 (
echo errorlevel is 0, good
) else (
echo unexpected errorlevel, got %errorlevel%
)
echo ------------ Testing del /a ------------
del /f/q *.test > nul
echo r > r.test
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
16cb9c4c
...
...
@@ -1009,6 +1009,12 @@ h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o@or_broken@h=%h i=a j=b k=c l=d e f g m
h=%h i=a j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=a j=c k= l= m= n=%n o=%o
h=%h i=b j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=b j=c k= l= m= n=%n o=%o
h=%h i=b j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=b j=c k= l= m= n=%n o=%o
------------ Testing del ------------
deleting 'file'
errorlevel is 0, good
successfully deleted 'file'
attempting to delete 'file', even though it is not present
errorlevel is 0, good
------------ Testing del /a ------------
not-r.test not found after delete, good
r.test found before delete, good
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment