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
b822e732
Commit
b822e732
authored
Feb 27, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Feb 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Support del /a[:].
parent
10c3764d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
1 deletion
+64
-1
builtins.c
programs/cmd/builtins.c
+64
-1
No files found.
programs/cmd/builtins.c
View file @
b822e732
...
...
@@ -224,6 +224,12 @@ void WCMD_create_dir (void) {
*
* Delete a file or wildcarded set.
*
* Note on /A:
* - Testing shows /A is repeatable, eg. /a-r /ar matches all files
* - Each set is a pattern, eg /ahr /as-r means
* readonly+hidden OR nonreadonly system files
* - The '-' applies to a single field, ie /a:-hr means read only
* non-hidden files
*/
void
WCMD_delete
(
int
recurse
)
{
...
...
@@ -292,9 +298,66 @@ char *p;
else
strcpy
(
fpath
,
fd
.
cFileName
);
if
(
!
(
fd
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
BOOL
ok
=
TRUE
;
char
*
nextA
=
strstr
(
quals
,
"/A"
);
/* Handle attribute matching (/A) */
if
(
nextA
!=
NULL
)
{
ok
=
FALSE
;
while
(
nextA
!=
NULL
&&
!
ok
)
{
char
*
thisA
=
(
nextA
+
2
);
BOOL
stillOK
=
TRUE
;
/* Skip optional : */
if
(
*
thisA
==
':'
)
thisA
++
;
/* Parse each of the /A[:]xxx in turn */
while
(
*
thisA
&&
*
thisA
!=
'/'
)
{
BOOL
negate
=
FALSE
;
BOOL
attribute
=
FALSE
;
/* Match negation of attribute first */
if
(
*
thisA
==
'-'
)
{
negate
=
TRUE
;
thisA
++
;
}
/* Match attribute */
switch
(
*
thisA
)
{
case
'R'
:
attribute
=
(
fd
.
dwFileAttributes
&
FILE_ATTRIBUTE_READONLY
);
break
;
case
'H'
:
attribute
=
(
fd
.
dwFileAttributes
&
FILE_ATTRIBUTE_HIDDEN
);
break
;
case
'S'
:
attribute
=
(
fd
.
dwFileAttributes
&
FILE_ATTRIBUTE_SYSTEM
);
break
;
case
'A'
:
attribute
=
(
fd
.
dwFileAttributes
&
FILE_ATTRIBUTE_ARCHIVE
);
break
;
default:
WCMD_output
(
"Syntax error
\n
"
);
}
/* Now check result, keeping a running boolean about whether it
matches all parsed attribues so far */
if
(
attribute
&&
!
negate
)
{
stillOK
=
stillOK
;
}
else
if
(
!
attribute
&&
negate
)
{
stillOK
=
stillOK
;
}
else
{
stillOK
=
FALSE
;
}
thisA
++
;
}
/* Save the running total as the final result */
ok
=
stillOK
;
/* Step on to next /A set */
nextA
=
strstr
(
nextA
+
1
,
"/A"
);
}
}
/* /P means prompt for each file */
if
(
strstr
(
quals
,
"/P"
)
!=
NULL
)
{
if
(
ok
&&
strstr
(
quals
,
"/P"
)
!=
NULL
)
{
char
question
[
MAXSTRING
];
/* Ask for confirmation */
...
...
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