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:
parent
4bc7a382fa
commit
63cd877bab
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue