From c72e8eb9178c707e167a6034dcd37e7d6cac3d44 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Tue, 14 Sep 2004 18:56:11 +0000 Subject: [PATCH] Finally solve that weird windows specific filebug. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1975 --- include/cross.h | 4 ++-- src/dos/drive_cache.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/cross.h b/include/cross.h index f4c106b0..d6e65d21 100644 --- a/include/cross.h +++ b/include/cross.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: cross.h,v 1.9 2004-08-23 09:34:21 harekiet Exp $ */ +/* $Id: cross.h,v 1.10 2004-09-14 18:56:11 qbix79 Exp $ */ #ifndef _CROSS_H #define _CROSS_H @@ -40,7 +40,7 @@ #if defined (WIN32) /* Win 32 */ -#define CROSS_FILENAME(blah) {if(blah && *blah && (blah[strlen(blah)-1] == '\\')) strcat(blah,".");} +#define CROSS_FILENAME(blah) #define CROSS_FILESPLIT '\\' #define F_OK 0 #else diff --git a/src/dos/drive_cache.cpp b/src/dos/drive_cache.cpp index 16d8e957..6554876f 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.36 2004-08-04 09:12:53 qbix79 Exp $ */ +/* $Id: drive_cache.cpp,v 1.37 2004-09-14 18:56:11 qbix79 Exp $ */ #include "drives.h" #include "dos_inc.h" @@ -176,6 +176,10 @@ char* DOS_Drive_Cache::GetExpandName(const char* path) GetLongName(dirInfo, dir); strcat(work,dir); } + + if(work && *work && ( work[strlen(work)-1] == CROSS_FILESPLIT ) ) + work[strlen(work)-1] = 0; // Remove trailing slashes + return work; };