1
0
Fork 0

fixed a bug in DOS_ChangeDir: if dir is a file - return false

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@459
This commit is contained in:
Ulf Wohlers 2002-10-28 20:32:47 +00:00
parent 4bc7a382fa
commit 63cd877bab

View file

@ -150,8 +150,16 @@ bool DOS_GetCurrentDir(Bit8u drive,char * buffer) {
}
bool DOS_ChangeDir(char * dir) {
// Be sure its not a file (Eye of the beholder 3)
char* str;
if (str=strchr(dir,'.')) {
if (isalpha(str[1]) || isdigit(str[1])) return false;
};
Bit8u drive;char fulldir[DOS_PATHLENGTH];
if (!DOS_MakeName(dir,fulldir,&drive)) return false;
if (Drives[drive]->TestDir(fulldir)) {
strcpy(Drives[drive]->curdir,fulldir);
return true;