diff --git a/kernel/dosfns.c b/kernel/dosfns.c index 51bfc84..52b7ca0 100644 --- a/kernel/dosfns.c +++ b/kernel/dosfns.c @@ -1327,7 +1327,7 @@ COUNT DosRename(BYTE FAR * path1, BYTE FAR * path2) return DosRenameTrue(PriPathName, SecPathName, D_ALL); } -COUNT DosMkdir(const char FAR * dir) +COUNT DosMkRmdir(const char FAR * dir, int action) { COUNT result; @@ -1336,33 +1336,12 @@ COUNT DosMkdir(const char FAR * dir) return result; if (result & IS_NETWORK) - return network_redirector(REM_MKDIR); + return network_redirector(action == 0x39 ? REM_MKDIR : REM_RMDIR); if (result & IS_DEVICE) return DE_ACCESS; - return dos_mkdir(PriPathName); -} - -/* This function is almost identical to DosMkdir(). - Maybe it would be nice to merge both functions. - -- 2001/09/03 ska*/ -COUNT DosRmdir(const char FAR * dir) -{ - COUNT result; - - result = truename(dir, PriPathName, CDS_MODE_CHECK_DEV_PATH); - - if (result < SUCCESS) - return result; - - if (result & IS_NETWORK) - return network_redirector(REM_RMDIR); - - if (result & IS_DEVICE) - return DE_ACCESS; - - return dos_rmdir(PriPathName); + return (action == 0x39 ? dos_mkdir : dos_rmdir)(PriPathName); } /* /// Added for SHARE. - Ron Cemer */ diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index 764b39e..fcf3d53 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -860,12 +860,9 @@ dispatch: /* Dos Create Directory */ case 0x39: - rc = DosMkdir(FP_DS_DX); - goto short_check; - /* Dos Remove Directory */ case 0x3a: - rc = DosRmdir(FP_DS_DX); + rc = DosMkRmdir(FP_DS_DX, lr.AL); goto short_check; /* Dos Change Directory */ diff --git a/kernel/proto.h b/kernel/proto.h index abe7bb7..6c2cbb3 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -112,8 +112,7 @@ UBYTE DosSelectDrv(UBYTE drv); COUNT DosDelete(BYTE FAR * path, int attrib); COUNT DosRename(BYTE FAR * path1, BYTE FAR * path2); COUNT DosRenameTrue(BYTE * path1, BYTE * path2, int attrib); -COUNT DosMkdir(const char FAR * dir); -COUNT DosRmdir(const char FAR * dir); +COUNT DosMkRmdir(const char FAR * dir, int action); struct dhdr FAR *IsDevice(const char FAR * FileName); BOOL IsShareInstalled(void); COUNT DosLockUnlock(COUNT hndl, LONG pos, LONG len, COUNT unlock);