1
0
Fork 0

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
This commit is contained in:
Peter Veenstra 2005-09-07 19:15:09 +00:00
parent 702a19d47f
commit ad7700fa3b
3 changed files with 12 additions and 6 deletions

View file

@ -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

View file

@ -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 <cctype>
#include <cstring>
@ -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, &sector[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;
}
}

View file

@ -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