Commit eb6d084f authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

cmd.exe: Support unquoted directories in CD command.

parent b9265bc3
......@@ -1046,18 +1046,31 @@ void WCMD_setshow_attrib (void) {
* Set/Show the current default directory
*/
void WCMD_setshow_default (void) {
void WCMD_setshow_default (char *command) {
BOOL status;
char string[1024];
char *pos;
if (strlen(param1) == 0) {
WINE_TRACE("Request change to directory '%s'\n", command);
if (strlen(command) == 0) {
GetCurrentDirectory (sizeof(string), string);
strcat (string, "\n");
WCMD_output (string);
}
else {
status = SetCurrentDirectory (param1);
/* Remove any double quotes, which may be in the
middle, eg. cd "C:\Program Files"\Microsoft is ok */
pos = string;
while (*command) {
if (*command != '"') *pos++ = *command;
command++;
}
*pos = 0x00;
/* Change to that directory */
WINE_TRACE("Really changing to directory '%s'\n", string);
status = SetCurrentDirectory (string);
if (!status) {
WCMD_print_error ();
return;
......
......@@ -63,7 +63,7 @@ void WCMD_run_program (char *command, int called);
void WCMD_setlocal (const char *command);
void WCMD_setshow_attrib (void);
void WCMD_setshow_date (void);
void WCMD_setshow_default (void);
void WCMD_setshow_default (char *command);
void WCMD_setshow_env (char *command);
void WCMD_setshow_path (char *command);
void WCMD_setshow_prompt (void);
......
......@@ -543,7 +543,7 @@ void WCMD_process_command (char *command)
break;
case WCMD_CD:
case WCMD_CHDIR:
WCMD_setshow_default ();
WCMD_setshow_default (p);
break;
case WCMD_CLS:
WCMD_clear_screen ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment