fixed bug in rename file <-> Dircache
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@636
This commit is contained in:
parent
496640572a
commit
e907697244
2 changed files with 4 additions and 2 deletions
|
@ -412,7 +412,7 @@ void DOS_Drive_Cache::CreateEntry(CFileInfo* dir, const char* name)
|
|||
// Read and copy file stats
|
||||
char buffer[CROSS_LEN];
|
||||
strcpy(buffer,dirPath);
|
||||
strcat(buffer,info->fullname);
|
||||
strcat(buffer,info->orgname);
|
||||
stat (buffer,&status);
|
||||
info->isDir = (S_ISDIR(status.st_mode)>0);
|
||||
// Check for long filenames...
|
||||
|
|
|
@ -225,11 +225,13 @@ bool localDrive::Rename(char * oldname,char * newname) {
|
|||
strcpy(newold,basedir);
|
||||
strcat(newold,oldname);
|
||||
CROSS_FILENAME(newold);
|
||||
dirCache.ExpandName(newold);
|
||||
|
||||
char newnew[CROSS_LEN];
|
||||
strcpy(newnew,basedir);
|
||||
strcat(newnew,newname);
|
||||
CROSS_FILENAME(newnew);
|
||||
int temp=rename(dirCache.GetExpandName(newold),dirCache.GetExpandName(newnew));
|
||||
int temp=rename(newold,dirCache.GetExpandName(newnew));
|
||||
if (temp==0) dirCache.CacheOut(newnew);
|
||||
return (temp==0);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue