diff --git a/include/dos_system.h b/include/dos_system.h index 68380b59..14593882 100644 --- a/include/dos_system.h +++ b/include/dos_system.h @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $Id: dos_system.h,v 1.14 2003-08-13 14:46:15 qbix79 Exp $ */ + #ifndef DOSSYSTEM_H_ #define DOSSYSTEM_H_ @@ -140,7 +142,7 @@ private: bool IsCachedIn (CFileInfo* dir); CFileInfo* FindDirInfo (const char* path, char* expandedPath); bool RemoveSpaces (char* str); - bool OpenDir (CFileInfo* dir, char* path, Bit16u& id); + bool OpenDir (CFileInfo* dir, const char* path, Bit16u& id); void CreateEntry (CFileInfo* dir, const char* name); Bit16u GetFreeID (CFileInfo* dir); void Clear (void); diff --git a/src/dos/drive_cache.cpp b/src/dos/drive_cache.cpp index 3a978309..0ff1ccd1 100644 --- a/src/dos/drive_cache.cpp +++ b/src/dos/drive_cache.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_cache.cpp,v 1.22 2003-08-06 14:46:58 qbix79 Exp $ */ +/* $Id: drive_cache.cpp,v 1.23 2003-08-13 14:45:31 qbix79 Exp $ */ #include "drives.h" #include "dos_inc.h" @@ -521,21 +521,23 @@ bool DOS_Drive_Cache::OpenDir(const char* path, Bit16u& id) return false; }; -bool DOS_Drive_Cache::OpenDir(CFileInfo* dir, char* expand, Bit16u& id) +bool DOS_Drive_Cache::OpenDir(CFileInfo* dir, const char* expand, Bit16u& id) { id = GetFreeID(dir); dirSearch[id] = dir; + char expandcopy [CROSS_LEN]; + strcpy(expandcopy,expand); // Add "/" char end[2]={CROSS_FILESPLIT,0}; - if (expand[strlen(expand)-1]!=CROSS_FILESPLIT) strcat(expand,end); + if (expandcopy[strlen(expandcopy)-1]!=CROSS_FILESPLIT) strcat(expandcopy,end); // open dir if (dirSearch[id]) { // open dir - DIR* dirp = opendir(expand); + DIR* dirp = opendir(expandcopy); if (dirp) { // Reset it.. closedir(dirp); - strcpy(dirPath,expand); + strcpy(dirPath,expandcopy); free[id] = false; return true; }