Merge pop_dmp optimization from the unstable kernel.

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1428 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2009-06-09 18:09:05 +00:00
parent d519f3db40
commit 288a2f396b

View File

@ -982,13 +982,19 @@ COUNT DosChangeDir(BYTE FAR * s)
return SUCCESS;
}
STATIC VOID pop_dmp(dmatch FAR * dmp)
STATIC int pop_dmp(int rc, dmatch FAR * dmp)
{
dmp->dm_attr_fnd = (BYTE) SearchDir.dir_attrib;
dmp->dm_time = SearchDir.dir_time;
dmp->dm_date = SearchDir.dir_date;
dmp->dm_size = (LONG) SearchDir.dir_size;
ConvertName83ToNameSZ(dmp->dm_name, (BYTE FAR *) SearchDir.dir_name);
dta = dmp;
if (rc == SUCCESS)
{
fmemcpy(dta, &sda_tmp_dm, 21);
dmp->dm_attr_fnd = (BYTE) SearchDir.dir_attrib;
dmp->dm_time = SearchDir.dir_time;
dmp->dm_date = SearchDir.dir_date;
dmp->dm_size = (LONG) SearchDir.dir_size;
ConvertName83ToNameSZ(dmp->dm_name, (BYTE FAR *) SearchDir.dir_name);
}
return rc;
}
COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name)
@ -1039,13 +1045,7 @@ COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name)
else
rc = dos_findfirst(attr, PriPathName);
dta = dmp;
if (rc == SUCCESS)
{
fmemcpy(dta, &sda_tmp_dm, 21);
pop_dmp(dmp);
}
return rc;
return pop_dmp(rc, dmp);
}
COUNT DosFindNext(void)
@ -1083,13 +1083,7 @@ COUNT DosFindNext(void)
rc = (sda_tmp_dm.dm_drive & 0x80) ?
network_redirector_fp(REM_FINDNEXT, &sda_tmp_dm) : dos_findnext();
dta = dmp;
if (rc == SUCCESS)
{
fmemcpy(dmp, &sda_tmp_dm, 21);
pop_dmp(dmp);
}
return rc;
return pop_dmp(rc, dmp);
}
COUNT DosGetFtime(COUNT hndl, date * dp, time * tp)