Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
ff1e7038
Commit
ff1e7038
authored
May 22, 2011
by
Dan Kegel
Committed by
Alexandre Julliard
May 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: del /a: test deleting readonly files, with fix.
parent
65b27c9e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
builtins.c
programs/cmd/builtins.c
+3
-2
test_builtins.cmd
programs/cmd/tests/test_builtins.cmd
+16
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+4
-0
No files found.
programs/cmd/builtins.c
View file @
ff1e7038
...
...
@@ -712,9 +712,10 @@ BOOL WCMD_delete (WCHAR *command, BOOL expectDir) {
/* Only proceed if ok to */
if
(
ok
)
{
/* If file is read only, and /F supplied, delete it */
/* If file is read only, and /
A:r or /
F supplied, delete it */
if
(
fd
.
dwFileAttributes
&
FILE_ATTRIBUTE_READONLY
&&
strstrW
(
quals
,
parmF
)
!=
NULL
)
{
((
wanted_attrs
&
FILE_ATTRIBUTE_READONLY
)
||
strstrW
(
quals
,
parmF
)
!=
NULL
))
{
SetFileAttributesW
(
fpath
,
fd
.
dwFileAttributes
&
~
FILE_ATTRIBUTE_READONLY
);
}
...
...
programs/cmd/tests/test_builtins.cmd
View file @
ff1e7038
...
...
@@ -78,6 +78,22 @@ if /i not foo==FOO echo if /i seems to be broken
if /I foo==FOO echo if /I seems to work
if /I not foo==FOO echo if /I seems to be broken
echo -----------Testing del /a-----------
del /f/q *.test > nul
echo r > r.test
attrib +r r.test
echo not-r > not-r.test
if not exist not-r.test echo not-r.test not found before delete, bad
del /a:-r *.test
if not exist not-r.test echo not-r.test not found after delete, good
if not exist r.test echo r.test not found before delete, bad
if exist r.test echo r.test found before delete, good
del /a:r *.test
if not exist r.test echo r.test not found after delete, good
if exist r.test echo r.test found after delete, bad
echo -----------Testing GOTO-----------
if a==a goto dest1
:dest1
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
ff1e7038
...
...
@@ -78,6 +78,10 @@ Testing case sensitivity with and without /i option
if seems to default to case sensitivity
if /i seems to work
if /I seems to work
-----------Testing del /a-----------
not-r.test not found after delete, good
r.test found before delete, good
r.test not found after delete, good
-----------Testing GOTO-----------
goto with no leading space worked
goto with a leading space worked
...
...
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