From e907697244c48a1c19c39009c977566032573710 Mon Sep 17 00:00:00 2001 From: Ulf Wohlers Date: Thu, 16 Jan 2003 15:13:18 +0000 Subject: [PATCH] fixed bug in rename file <-> Dircache Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@636 --- src/dos/drive_cache.cpp | 2 +- src/dos/drive_local.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dos/drive_cache.cpp b/src/dos/drive_cache.cpp index 124b9b45..a604aecc 100644 --- a/src/dos/drive_cache.cpp +++ b/src/dos/drive_cache.cpp @@ -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... diff --git a/src/dos/drive_local.cpp b/src/dos/drive_local.cpp index 72e9f7fd..831a1f7c 100644 --- a/src/dos/drive_local.cpp +++ b/src/dos/drive_local.cpp @@ -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);