fixed return value of findfirst
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@983
This commit is contained in:
parent
51b1d83a6d
commit
34c95efc05
3 changed files with 8 additions and 3 deletions
|
@ -206,14 +206,13 @@ bool DOS_FindFirst(char * search,Bit16u attr) {
|
|||
}
|
||||
dta.SetupSearch(drive,(Bit8u)attr,pattern);
|
||||
if (Drives[drive]->FindFirst(dir,dta)) return true;
|
||||
DOS_SetError(DOSERR_NO_MORE_FILES);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DOS_FindNext(void) {
|
||||
DOS_DTA dta(dos.dta);
|
||||
if (Drives[dta.GetSearchDrive()]->FindNext(dta)) return true;
|
||||
DOS_SetError(DOSERR_NO_MORE_FILES);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,11 @@ bool localDrive::FindFirst(char * _dir,DOS_DTA & dta) {
|
|||
if (tempDir[strlen(tempDir)-1]!=CROSS_FILESPLIT) strcat(tempDir,end);
|
||||
|
||||
Bit16u id;
|
||||
if (!dirCache.OpenDir(tempDir,id)) return false;
|
||||
if (!dirCache.OpenDir(tempDir,id))
|
||||
{
|
||||
DOS_SetError(DOSERR_PATH_NOT_FOUND);
|
||||
return false;
|
||||
}
|
||||
strcpy(srchInfo[id].srch_dir,tempDir);
|
||||
dta.SetDirID(id);
|
||||
|
||||
|
@ -139,6 +143,7 @@ bool localDrive::FindNext(DOS_DTA & dta) {
|
|||
|
||||
again:
|
||||
if (!dirCache.ReadDir(id,dir_ent)) {
|
||||
DOS_SetError(DOSERR_NO_MORE_FILES);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -200,6 +200,7 @@ bool Virtual_Drive::FindNext(DOS_DTA & dta) {
|
|||
}
|
||||
search_file=search_file->next;
|
||||
}
|
||||
DOS_SetError(DOSERR_NO_MORE_FILES);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue