Skip to content

Commit 5f3e059

Browse files
committed
build fix for TurboC, fix findfirst (broken by previous truename changes)
1 parent a721d32 commit 5f3e059

3 files changed

Lines changed: 10 additions & 13 deletions

File tree

kernel/dosfns.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828

2929
#include "portab.h"
3030

31-
#ifdef VERSION_STRINGS
32-
static BYTE *dosfnsRcsId =
33-
"$Id: dosfns.c 1564 2011-04-08 18:27:48Z bartoldeman $";
34-
#endif
35-
3631
#include "globals.h"
3732
#include "debug.h"
3833

@@ -975,7 +970,6 @@ COUNT DosGetExtFree(BYTE FAR * DriveString, struct xfreespace FAR * xfsp)
975970
COUNT DosGetCuDir(UBYTE drive, BYTE FAR * s)
976971
{
977972
char path[3];
978-
short result;
979973

980974
if (drive-- == 0) /* get default drive or convert to 0 = A:, 1 = B:, ... */
981975
drive = default_drive;
@@ -984,11 +978,8 @@ COUNT DosGetCuDir(UBYTE drive, BYTE FAR * s)
984978
path[2] = '\0';
985979

986980
DebugPrintf(("CWD [%s]\n", path));
987-
if ((result = truename(path, PriPathName, CDS_MODE_SKIP_PHYSICAL)) < SUCCESS)
988-
{
989-
DebugPrintf(("CWD failed 0x%0x\n", result));
981+
if (truename(path, PriPathName, CDS_MODE_SKIP_PHYSICAL) < SUCCESS)
990982
return DE_INVLDDRV;
991-
}
992983

993984
/* skip d:\ */
994985
fstrcpy(s, PriPathName + 3);
@@ -1476,7 +1467,7 @@ COUNT DosTruename(const char FAR *src, char FAR *dest)
14761467
Therefore, the name is created in an internal buffer
14771468
and copied into the user buffer only on success.
14781469
*/
1479-
COUNT rc = truename(src, PriPathName, CDS_MODE_ALLOW_WILDCARDS|CDS_MODE_CHECK_DEV_PATH);
1470+
COUNT rc = truename(src, PriPathName, CDS_MODE_ALLOW_WILDCARDS);
14801471
if (rc >= SUCCESS)
14811472
{
14821473
fstrcpy(dest, PriPathName);

kernel/inthndlr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ VOID ASMCFUNC int21_syscall(iregs FAR * irp)
170170
#ifdef DEBUG
171171
case 0xfe:
172172
bDumpRegs = !bDumpRegs;
173+
irp->AX = bDumpRegs;
173174
break;
174175
#endif
175176

kernel/newstuff.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ COUNT truename(const char FAR * src, char * dest, COUNT mode)
326326
When given a character device, Truename or Open allows device name to be prefixed by invalid
327327
drive letter and\or optional \DEV\ directory prefix, however any other directory including
328328
root path (\) will always return error. However, if drive is valid, then for character
329-
devices any path may be provided.
329+
devices any path may be provided for truename but not findfirst [which path must be valid].
330330
For example:
331331
CON will use default drive and assuming default is X: then same as X:CON
332332
X:CON and X:\DEV\CON will succeed regardless if X: is valid or not
@@ -346,11 +346,12 @@ COUNT truename(const char FAR * src, char * dest, COUNT mode)
346346
/* is this a character device (dhp != NULL)? if so check special cases
347347
if cdsEntry is not NULL then valid drive, so any path acceptable for character device
348348
*/
349-
if (dhp && (mode & CDS_MODE_CHECK_DEV_PATH) && (cdsEntry == NULL))
349+
if (dhp && (cdsEntry == NULL))
350350
{
351351
/* determine if drive letter provided (we know at least 1 character long) */
352352
const char FAR *s = src+1;
353353
const char FAR *hasSlash;
354+
354355
if (*s == ':') s++; else s--; /* skip drive (X:) if provided */
355356
/* s points to start of device name or path, just past optional drive letter */
356357

@@ -679,6 +680,10 @@ COUNT truename(const char FAR * src, char * dest, COUNT mode)
679680
}
680681
/* nothing found => continue normally */
681682
}
683+
if ((mode & CDS_MODE_CHECK_DEV_PATH) &&
684+
((result & (IS_DEVICE|IS_NETWORK)) == IS_DEVICE) &&
685+
dest[2] != '/' && !dir_exists(dest))
686+
return DE_PATHNOTFND;
682687

683688
/* Note: Not reached on error or if JOIN or QRemote_Fn (2f.1123) matched */
684689
if (mode==CDS_MODE_ALLOW_WILDCARDS) /* DosTruename mode */

0 commit comments

Comments
 (0)