From ad7700fa3b089305608644586b94c77b9ad7a36c Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Wed, 7 Sep 2005 19:15:09 +0000 Subject: [PATCH] Add patch:126539:"cd image, fix for files without extension" from prompt. Fix a typo that probably broke endian support for isos Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2302 --- configure.in | 2 +- src/dos/drive_iso.cpp | 12 +++++++++--- src/dos/drives.h | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 7cc83ea8..d4d95ced 100644 --- a/configure.in +++ b/configure.in @@ -71,7 +71,7 @@ return 0; AM_PATH_ALSA(0.9.0, AC_DEFINE(HAVE_ALSA,1,[Define to 1 to use ALSA for MIDI]) , : ) -#Check for big endian machine, should #define WORD_BIGENDIAN if so +#Check for big endian machine, should #define WORDS_BIGENDIAN if so AC_C_BIGENDIAN #Features to enable/disable diff --git a/src/dos/drive_iso.cpp b/src/dos/drive_iso.cpp index 95ea51d9..f95421e4 100644 --- a/src/dos/drive_iso.cpp +++ b/src/dos/drive_iso.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_iso.cpp,v 1.9 2005-08-11 18:57:48 qbix79 Exp $ */ +/* $Id: drive_iso.cpp,v 1.10 2005-09-07 19:15:09 qbix79 Exp $ */ #include #include @@ -58,7 +58,7 @@ isoFile::isoFile(isoDrive *drive, const char *name, FileStat_Block *stat, Bit32u fileEnd = fileBegin + size; cachedSector = -1; open = true; - info = info; + this->info = info; this->name = NULL; SetName(name); } @@ -435,6 +435,12 @@ bool isoDrive :: lookupSingle(isoDirEntry *de, const char *name, Bit32u start, B { Bit32u end = start + length / ISO_FRAMESIZE; if (length % ISO_FRAMESIZE != 0) end++; + + // copy filename and if it has no extension remove the trailing dot + char newname[38]; + safe_strncpy(newname, name, 38); + int name_len = strlen(newname); + if (name_len > 0 && newname[name_len - 1] == '.') newname[name_len - 1] = 0; for(Bit32u i = start; i < end; i++) { Bit8u sector[ISO_FRAMESIZE]; @@ -445,7 +451,7 @@ bool isoDrive :: lookupSingle(isoDirEntry *de, const char *name, Bit32u start, B int deLength = readDirEntry(de, §or[pos]); if (deLength < 1) return false; pos += deLength; - int tmp = strncasecmp((char*)de->ident, name, 38); + int tmp = strncasecmp((char*)de->ident, newname, 38); if (tmp == 0) return true; } } diff --git a/src/dos/drives.h b/src/dos/drives.h index 020f7f8c..644673da 100644 --- a/src/dos/drives.h +++ b/src/dos/drives.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drives.h,v 1.28 2005-03-25 08:39:05 qbix79 Exp $ */ +/* $Id: drives.h,v 1.29 2005-09-07 19:15:09 qbix79 Exp $ */ #ifndef _DRIVES_H__ #define _DRIVES_H__ @@ -264,7 +264,7 @@ struct isoDirEntry { #pragma pack () #endif -#if defined (WORD_BIGENDIAN) +#if defined (WORDS_BIGENDIAN) #define EXTENT_LOCATION(de) ((de).extentLocationM) #define DATA_LENGTH(de) ((de).dataLengthM) #else