FcbOpen/FcbFindFirstNext:

Fix a consequence of truename's funny behaviour:
truename(c:nul) = c:/nul and truename(c:/nul) = c:\nul
and for FCBs it's still easiest to call truename twice
so we have to copy c:/nul back to c:nul to compensate.
This fixes the EJECT problem from Lucho.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@777 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-02-08 20:58:09 +00:00
parent de444743cc
commit b34b68a265

View File

@ -407,6 +407,13 @@ UBYTE FcbOpen(xfcb FAR * lpXfcb, unsigned flags)
/* pass attribute without constraints (dangerous for directories) */ /* pass attribute without constraints (dangerous for directories) */
attr = lpXfcb->xfcb_attrib; attr = lpXfcb->xfcb_attrib;
/* for c:/nul c:nul must be opened instead!
* this is a consequence of truename's funny behaviour:
* truename(c:nul) = c:/nul and truename(c:/nul) = c:\nul
* and for FCBs it's easiest to call truename twice
*/
if (SecPathName[2] == '/')
strcpy(&SecPathName[2], &SecPathName[3]);
sft_idx = (short)DosOpenSft(SecPathName, flags, attr); sft_idx = (short)DosOpenSft(SecPathName, flags, attr);
if (sft_idx < 0) if (sft_idx < 0)
{ {
@ -675,6 +682,9 @@ UBYTE FcbFindFirstNext(xfcb FAR * lpXfcb, BOOL First)
lpDir += 7; lpDir += 7;
} }
/* for c:/nul c:nul must be opened instead! (see above) */
if (SecPathName[2] == '/')
strcpy(&SecPathName[2], &SecPathName[3]);
CritErrCode = -(First ? DosFindFirst(wAttr, SecPathName) : DosFindNext()); CritErrCode = -(First ? DosFindFirst(wAttr, SecPathName) : DosFindNext());
if (CritErrCode != SUCCESS) if (CritErrCode != SUCCESS)
{ {