Commit 13c5117f authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

- Fixed move and copy when no destination supplied (assumes '.' now as

per windows) - Fixed move so uses full path name for destination file, and if destination is a directory, uses original filename.
parent 28cbea80
......@@ -93,6 +93,12 @@ char string[8], outpath[MAX_PATH], inpath[MAX_PATH], *infile;
WCMD_output ("Wildcards not yet supported\n");
return;
}
/* If no destination supplied, assume current directory */
if (param2[0] == 0x00) {
strcpy(param2, ".");
}
GetFullPathName (param2, sizeof(outpath), outpath, NULL);
hff = FindFirstFile (outpath, &fd);
if (hff != INVALID_HANDLE_VALUE) {
......@@ -103,6 +109,7 @@ char string[8], outpath[MAX_PATH], inpath[MAX_PATH], *infile;
}
FindClose (hff);
}
force = (strstr (quals, "/Y") != NULL);
if (!force) {
hff = FindFirstFile (outpath, &fd);
......@@ -402,12 +409,33 @@ char condition[MAX_PATH], *command, *s;
void WCMD_move () {
int status;
char outpath[MAX_PATH], inpath[MAX_PATH], *infile;
WIN32_FIND_DATA fd;
HANDLE hff;
if ((strchr(param1,'*') != NULL) || (strchr(param1,'%') != NULL)) {
WCMD_output ("Wildcards not yet supported\n");
return;
}
status = MoveFile (param1, param2);
}
/* If no destination supplied, assume current directory */
if (param2[0] == 0x00) {
strcpy(param2, ".");
}
/* If 2nd parm is directory, then use original filename */
GetFullPathName (param2, sizeof(outpath), outpath, NULL);
hff = FindFirstFile (outpath, &fd);
if (hff != INVALID_HANDLE_VALUE) {
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
GetFullPathName (param1, sizeof(inpath), inpath, &infile);
strcat (outpath, "\\");
strcat (outpath, infile);
}
FindClose (hff);
}
status = MoveFile (param1, outpath);
if (!status) WCMD_print_error ();
}
......
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