Change how DosGetExtFree checks for drive so int 21h/7303h more lax about path given, support driver specifier with or without slash (C: or C:\) and just slash (\) for current drive (does allow some additional bogus paths to return success)

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1369 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Kenneth J Davis 2009-04-30 05:16:31 +00:00
parent 58de498fca
commit ae3d48ab33

View File

@ -884,7 +884,6 @@ UWORD DosGetFree(UBYTE drive, UWORD * navc, UWORD * bps, UWORD * nc)
}
#ifdef WITHFAT32
/* network names like \\SERVER\C aren't supported yet */
#define IS_SLASH(ch) (ch == '\\' || ch == '/')
COUNT DosGetExtFree(BYTE FAR * DriveString, struct xfreespace FAR * xfsp)
{
@ -892,13 +891,19 @@ COUNT DosGetExtFree(BYTE FAR * DriveString, struct xfreespace FAR * xfsp)
struct cds FAR *cdsp;
UCOUNT rg[4];
if (IS_SLASH(DriveString[0]) || !IS_SLASH(DriveString[2])
|| DriveString[1] != ':')
return DE_INVLDDRV;
/*
DriveString should be in form of "C:", "C:\", "\",
where "\" is treated as a request for the current drive,
or network name in form "\\SERVER\share"
however, network names like \\SERVER\C aren't supported yet
*/
cdsp = NULL;
if (DriveString[1] == ':')
cdsp = get_cds(DosUpFChar(*DriveString) - 'A'); /* assume drive specified */
else if (IS_SLASH(DriveString[0]) && !IS_SLASH(DriveString[1]))
cdsp = get_cds(default_drive); /* use current drive */
cdsp = get_cds(DosUpFChar(*DriveString) - 'A');
if (cdsp == NULL)
if (cdsp == NULL) /* either error, really bad string, or network name */
return DE_INVLDDRV;
if (cdsp->cdsFlags & CDSNETWDRV)