From 87216faa9b27ca75f84934caea569ccf4e002e9e Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 27 Oct 2003 14:16:59 +0000 Subject: [PATCH] Added patch 826821 from phearbear Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1382 --- include/support.h | 3 +++ src/dos/drive_cache.cpp | 8 ++++---- src/dos/drives.cpp | 2 +- src/shell/shell_batch.cpp | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/support.h b/include/support.h index 8e260588..1e850f14 100644 --- a/include/support.h +++ b/include/support.h @@ -33,6 +33,9 @@ //#define nocasestrcmp(a,b) stricmp(a,b) #endif +#ifdef HAVE_STRINGS_H +#include +#endif void strreplace(char * str,char o,char n); char *ltrim(char *str); diff --git a/src/dos/drive_cache.cpp b/src/dos/drive_cache.cpp index 4319c246..bdf363a8 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.27 2003-10-09 13:49:48 finsterr Exp $ */ +/* $Id: drive_cache.cpp,v 1.28 2003-10-27 14:16:59 qbix79 Exp $ */ #include "drives.h" #include "dos_inc.h" @@ -162,7 +162,7 @@ char* DOS_Drive_Cache::GetExpandName(const char* path) work[0] = 0; strcpy (dir,path); - char* pos = strrchr(path,CROSS_FILESPLIT); + const char* pos = strrchr(path,CROSS_FILESPLIT); if (pos) dir[pos-path+1] = 0; CFileInfo* dirInfo = FindDirInfo(dir, work); @@ -183,7 +183,7 @@ void DOS_Drive_Cache::AddEntry(const char* path, bool checkExists) char expand [CROSS_LEN]; CFileInfo* dir = FindDirInfo(path,expand); - char* pos = strrchr(path,CROSS_FILESPLIT); + const char* pos = strrchr(path,CROSS_FILESPLIT); if (pos) { strcpy(file,pos+1); @@ -435,7 +435,7 @@ DOS_Drive_Cache::CFileInfo* DOS_Drive_Cache::FindDirInfo(const char* path, char* char dir [CROSS_LEN]; char work [CROSS_LEN]; const char* start = path; - char* pos; + const char* pos; CFileInfo* curDir = dirBase; Bit16u id; diff --git a/src/dos/drives.cpp b/src/dos/drives.cpp index 65d6483f..ea712f0e 100644 --- a/src/dos/drives.cpp +++ b/src/dos/drives.cpp @@ -27,7 +27,7 @@ bool WildFileCmp(const char * file, const char * wild) char file_ext[4]; char wild_name[9]; char wild_ext[4]; - char * find_ext; + const char * find_ext; Bitu r; strcpy(file_name," "); diff --git a/src/shell/shell_batch.cpp b/src/shell/shell_batch.cpp index c927e889..538f3e30 100644 --- a/src/shell/shell_batch.cpp +++ b/src/shell/shell_batch.cpp @@ -89,7 +89,7 @@ emptyline: if (!first) continue; *first++=0; std::string temp; if (shell->GetEnvStr(cmd_read,temp)) { - char * equals=strchr(temp.c_str(),'='); + const char * equals=strchr(temp.c_str(),'='); if (!equals) continue; equals++; strcpy(cmd_write,equals);