cmd: mkdir: Handle multiple arguments.

This commit is contained in:
Dan Kegel 2011-08-02 13:02:19 -07:00 committed by Alexandre Julliard
parent 62802b8bdf
commit 15ce9a5784
4 changed files with 16 additions and 7 deletions

View File

@ -523,13 +523,22 @@ static BOOL create_full_path(WCHAR* path)
return ret;
}
void WCMD_create_dir (void) {
void WCMD_create_dir (WCHAR *command) {
int argno = 0;
WCHAR *argN = command;
if (param1[0] == 0x00) {
WCMD_output (WCMD_LoadMessage(WCMD_NOARG));
return;
}
if (!create_full_path(param1)) WCMD_print_error ();
/* Loop through all args */
while (TRUE) {
WCHAR *thisArg = WCMD_parameter(command, argno++, &argN);
if (!argN) break;
if (!create_full_path(thisArg)) {
WCMD_print_error ();
}
}
}
/* Parse the /A options given by the user on the commandline

View File

@ -284,9 +284,9 @@ dir created
@todo_wine@1
@todo_wine@ok, foo\bar created
foo created
@todo_wine@bar created
@todo_wine@foobar created
@todo_wine@bar\baz created
bar created
foobar created
bar\baz created
----------- Testing rmdir -----------
0
dir removed

View File

@ -56,7 +56,7 @@ void WCMD_choice (WCHAR *);
void WCMD_clear_screen (void);
void WCMD_color (void);
void WCMD_copy (void);
void WCMD_create_dir (void);
void WCMD_create_dir (WCHAR *);
BOOL WCMD_delete (WCHAR *);
void WCMD_directory (WCHAR *);
void WCMD_echo (const WCHAR *);

View File

@ -1472,7 +1472,7 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
break;
case WCMD_MD:
case WCMD_MKDIR:
WCMD_create_dir ();
WCMD_create_dir (p);
break;
case WCMD_MOVE:
WCMD_move ();