1
0
Fork 0

Handle files without an extension better.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3682
This commit is contained in:
Peter Veenstra 2011-03-06 14:52:14 +00:00
parent e1ccef0bad
commit 3610cc8220

View file

@ -494,13 +494,13 @@ int isoDrive :: readDirEntry(isoDirEntry *de, Bit8u *data) {
if (de->ident[tmp - 1] == '.') de->ident[tmp - 1] = 0;
}
}
const char* dotpos = strchr((char*)de->ident, '.');
char* dotpos = strchr((char*)de->ident, '.');
if (dotpos!=NULL) {
if (strlen(dotpos)>4) dotpos[4]=0;
if (dotpos-(char*)de->ident>8) {
strcpy((char*)(&de->ident[8]),dotpos);
}
}
if (strlen((char*)de->ident)>12) de->ident[12]=0;
} else if (strlen((char*)de->ident)>8) de->ident[8]=0;
return de->length;
}