Small improvement to copy when dealing with a device (fixes a warning from the drive_cache on the findnext).
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3874
This commit is contained in:
parent
767a95380b
commit
144aa917e3
1 changed files with 7 additions and 6 deletions
|
@ -583,8 +583,8 @@ void DOS_Shell::CMD_COPY(char * args) {
|
|||
dos.dta(save_dta);
|
||||
return;
|
||||
}
|
||||
// Gather all sources (extension to copy more then 1 file specified at commandline)
|
||||
// Concatating files go as follows: All parts except for the last bear the concat flag.
|
||||
// Gather all sources (extension to copy more then 1 file specified at command line)
|
||||
// Concatenating files go as follows: All parts except for the last bear the concat flag.
|
||||
// This construction allows them to be counted (only the non concat set)
|
||||
char* source_p = NULL;
|
||||
char source_x[DOS_PATHLENGTH+CROSS_LEN];
|
||||
|
@ -670,7 +670,7 @@ void DOS_Shell::CMD_COPY(char * args) {
|
|||
char* temp = strstr(pathTarget,"*.*");
|
||||
if(temp) *temp = 0;//strip off *.* from target
|
||||
|
||||
// add '\\' if target is a directoy
|
||||
// add '\\' if target is a directory
|
||||
if (pathTarget[strlen(pathTarget)-1]!='\\') {
|
||||
if (DOS_FindFirst(pathTarget,0xffff & ~DOS_ATTR_VOLUME)) {
|
||||
dta.GetResult(name,size,date,time,attr);
|
||||
|
@ -703,7 +703,7 @@ void DOS_Shell::CMD_COPY(char * args) {
|
|||
strcpy(nameTarget,pathTarget);
|
||||
if (nameTarget[strlen(nameTarget)-1]=='\\') strcat(nameTarget,name);
|
||||
|
||||
//Don't create a newfile when in concat mode
|
||||
//Don't create a new file when in concat mode
|
||||
if (oldsource.concat || DOS_CreateFile(nameTarget,0,&targetHandle)) {
|
||||
Bit32u dummy=0;
|
||||
//In concat mode. Open the target and seek to the eof
|
||||
|
@ -731,8 +731,9 @@ void DOS_Shell::CMD_COPY(char * args) {
|
|||
}
|
||||
} else WriteOut(MSG_Get("SHELL_CMD_COPY_FAILURE"),const_cast<char*>(source.filename.c_str()));
|
||||
};
|
||||
//On the next file
|
||||
ret = DOS_FindNext();
|
||||
//On to the next file if the previous one wasn't a device
|
||||
if ((attr&DOS_ATTR_DEVICE) == 0) ret = DOS_FindNext();
|
||||
else ret = false;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue