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
10c3764d
Commit
10c3764d
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 /f.
parent
fe29ed41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
builtins.c
programs/cmd/builtins.c
+19
-10
No files found.
programs/cmd/builtins.c
View file @
10c3764d
...
...
@@ -271,14 +271,17 @@ char *p;
WCMD_output
(
"%s :File Not Found
\n
"
,
param1
);
return
;
}
/* Support del <dirname> by just deleting all files dirname\* */
if
((
strchr
(
param1
,
'*'
)
==
NULL
)
&&
(
strchr
(
param1
,
'?'
)
==
NULL
)
&&
(
!
recurse
)
&&
(
fd
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
strcat
(
param1
,
"
\\
*"
);
FindClose
(
hff
);
WCMD_delete
(
1
);
return
;
}
if
((
strchr
(
param1
,
'*'
)
!=
NULL
)
||
(
strchr
(
param1
,
'?'
)
!=
NULL
))
{
}
else
{
/* Build the filename to delete as <supplied directory>\<findfirst filename> */
strcpy
(
fpath
,
param1
);
do
{
p
=
strrchr
(
fpath
,
'\\'
);
...
...
@@ -288,28 +291,34 @@ char *p;
}
else
strcpy
(
fpath
,
fd
.
cFileName
);
if
(
!
(
fd
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
BOOL
ok
=
TRUE
;
/* /P means prompt for each file */
if
(
strstr
(
quals
,
"/P"
)
!=
NULL
)
{
BOOL
ok
;
char
question
[
MAXSTRING
];
/* Ask for confirmation */
sprintf
(
question
,
"%s, Delete"
,
fpath
);
ok
=
WCMD_ask_confirm
(
question
,
FALSE
);
}
/* Only delete if answer is 'Y' */
if
(
ok
&&
!
DeleteFile
(
fpath
))
WCMD_print_error
();
}
else
{
/* Only proceed if ok to */
if
(
ok
)
{
/* If file is read only, and /F supplied, delete it */
if
(
fd
.
dwFileAttributes
&
FILE_ATTRIBUTE_READONLY
&&
strstr
(
quals
,
"/F"
)
!=
NULL
)
{
SetFileAttributes
(
fpath
,
fd
.
dwFileAttributes
&
~
FILE_ATTRIBUTE_READONLY
);
}
/* Now do the delete */
if
(
!
DeleteFile
(
fpath
))
WCMD_print_error
();
}
}
}
while
(
FindNextFile
(
hff
,
&
fd
)
!=
0
);
FindClose
(
hff
);
}
else
{
if
(
!
DeleteFile
(
param1
))
WCMD_print_error
();
FindClose
(
hff
);
}
}
/****************************************************************************
...
...
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