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
0efa91de
Commit
0efa91de
authored
Mar 04, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Mar 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Support rd dir1 dir2.
parent
cc3dd00c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
30 deletions
+48
-30
builtins.c
programs/cmd/builtins.c
+46
-28
wcmd.h
programs/cmd/wcmd.h
+1
-1
wcmdmain.c
programs/cmd/wcmdmain.c
+1
-1
No files found.
programs/cmd/builtins.c
View file @
0efa91de
...
@@ -36,6 +36,9 @@
...
@@ -36,6 +36,9 @@
#include "wcmd.h"
#include "wcmd.h"
#include <shellapi.h>
#include <shellapi.h>
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
cmd
);
void
WCMD_execute
(
char
*
orig_command
,
char
*
parameter
,
char
*
substitution
);
void
WCMD_execute
(
char
*
orig_command
,
char
*
parameter
,
char
*
substitution
);
...
@@ -752,44 +755,59 @@ void WCMD_pause (void) {
...
@@ -752,44 +755,59 @@ void WCMD_pause (void) {
* Delete a directory.
* Delete a directory.
*/
*/
void
WCMD_remove_dir
(
voi
d
)
{
void
WCMD_remove_dir
(
char
*
comman
d
)
{
if
(
param1
[
0
]
==
0x00
)
{
int
argno
=
0
;
WCMD_output
(
"Argument missing
\n
"
);
int
argsProcessed
=
0
;
return
;
char
*
argN
=
command
;
}
/* If subdirectory search not supplied, just try to remove
/* Loop through all args */
and report error if it fails (eg if it contains a file) */
while
(
argN
)
{
if
(
strstr
(
quals
,
"/S"
)
==
NULL
)
{
char
*
thisArg
=
WCMD_parameter
(
command
,
argno
++
,
&
argN
);
if
(
!
RemoveDirectory
(
param1
))
WCMD_print_error
();
if
(
argN
&&
argN
[
0
]
!=
'/'
)
{
WINE_TRACE
(
"rd: Processing arg %s (quals:%s)
\n
"
,
thisArg
,
quals
);
argsProcessed
++
;
/* Otherwise use ShFileOp to recursively remove a directory */
/* If subdirectory search not supplied, just try to remove
}
else
{
and report error if it fails (eg if it contains a file) */
if
(
strstr
(
quals
,
"/S"
)
==
NULL
)
{
if
(
!
RemoveDirectory
(
thisArg
))
WCMD_print_error
();
SHFILEOPSTRUCT
lpDir
;
/* Otherwise use ShFileOp to recursively remove a directory */
}
else
{
/* Ask first */
SHFILEOPSTRUCT
lpDir
;
if
(
strstr
(
quals
,
"/Q"
)
==
NULL
)
{
BOOL
ok
;
char
question
[
MAXSTRING
];
/* Ask for confirmation */
/* Ask first */
sprintf
(
question
,
"%s, "
,
param1
);
if
(
strstr
(
quals
,
"/Q"
)
==
NULL
)
{
ok
=
WCMD_ask_confirm
(
question
,
TRUE
);
BOOL
ok
;
char
question
[
MAXSTRING
];
/* Abort if answer is 'N' */
/* Ask for confirmation */
if
(
!
ok
)
return
;
sprintf
(
question
,
"%s, "
,
thisArg
);
ok
=
WCMD_ask_confirm
(
question
,
TRUE
);
/* Abort if answer is 'N' */
if
(
!
ok
)
return
;
}
/* Do the delete */
lpDir
.
hwnd
=
NULL
;
lpDir
.
pTo
=
NULL
;
lpDir
.
pFrom
=
thisArg
;
lpDir
.
fFlags
=
FOF_SILENT
|
FOF_NOCONFIRMATION
|
FOF_NOERRORUI
;
lpDir
.
wFunc
=
FO_DELETE
;
if
(
SHFileOperationA
(
&
lpDir
))
WCMD_print_error
();
}
}
}
}
/* Do the delete */
/* Handle no valid args */
lpDir
.
hwnd
=
NULL
;
if
(
argsProcessed
==
0
)
{
lpDir
.
pTo
=
NULL
;
WCMD_output
(
"Argument missing
\n
"
);
lpDir
.
pFrom
=
param1
;
return
;
lpDir
.
fFlags
=
FOF_SILENT
|
FOF_NOCONFIRMATION
|
FOF_NOERRORUI
;
lpDir
.
wFunc
=
FO_DELETE
;
if
(
SHFileOperationA
(
&
lpDir
))
WCMD_print_error
();
}
}
}
}
/****************************************************************************
/****************************************************************************
...
...
programs/cmd/wcmd.h
View file @
0efa91de
...
@@ -55,7 +55,7 @@ void WCMD_print_error (void);
...
@@ -55,7 +55,7 @@ void WCMD_print_error (void);
void
WCMD_process_command
(
char
*
command
);
void
WCMD_process_command
(
char
*
command
);
void
WCMD_pushd
(
void
);
void
WCMD_pushd
(
void
);
int
WCMD_read_console
(
char
*
string
,
int
str_len
);
int
WCMD_read_console
(
char
*
string
,
int
str_len
);
void
WCMD_remove_dir
(
voi
d
);
void
WCMD_remove_dir
(
char
*
comman
d
);
void
WCMD_rename
(
void
);
void
WCMD_rename
(
void
);
void
WCMD_run_program
(
char
*
command
,
int
called
);
void
WCMD_run_program
(
char
*
command
,
int
called
);
void
WCMD_setlocal
(
const
char
*
command
);
void
WCMD_setlocal
(
const
char
*
command
);
...
...
programs/cmd/wcmdmain.c
View file @
0efa91de
...
@@ -530,7 +530,7 @@ void WCMD_process_command (char *command)
...
@@ -530,7 +530,7 @@ void WCMD_process_command (char *command)
break
;
break
;
case
WCMD_RD
:
case
WCMD_RD
:
case
WCMD_RMDIR
:
case
WCMD_RMDIR
:
WCMD_remove_dir
();
WCMD_remove_dir
(
p
);
break
;
break
;
case
WCMD_SETLOCAL
:
case
WCMD_SETLOCAL
:
WCMD_setlocal
(
p
);
WCMD_setlocal
(
p
);
...
...
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