Mktemp (21.5a) only inserts leading backslash in temp file name

if no directory given in template if DOS version is 5.
Older and newer DOS versions just use no dirspec in that case.
This helps ftp.sac.sk/pub/sac/pack/iup067.zip exepacker which
tries to rename the temp file to a file in current directory.

Prepared Truename (21.60) to return 0 if okay, 3a00 if char dev
(and not JOIN / network?). May need further coding to actually
have the intended effect...? Note: The shell TRUENAME command
may change names for display!

Changed the "true DOS version" for FAT16 kernels from 5.0 to
6.22 to reflect the updates in 21.5a and 21.60, other 5 / 6
differences are not simply in the kernel but more in COUNTRY,
KEYB, HIMEM, SMARTDRV, DBLSPACE, EMM386, COMMAND and so on.
In addition, 6.22 is a popular version number to report :-).


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1345 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Eric Auer 2007-07-28 19:03:40 +00:00
parent 65798a9203
commit ab53a50c49
3 changed files with 20 additions and 8 deletions

View File

@ -38,14 +38,14 @@ static BYTE *date_hRcsId =
#define MAJOR_RELEASE 7 #define MAJOR_RELEASE 7
#define MINOR_RELEASE 10 #define MINOR_RELEASE 10
#else #else
#define MAJOR_RELEASE 5 #define MAJOR_RELEASE 6
#define MINOR_RELEASE 00 #define MINOR_RELEASE 22
#endif #endif
#define REVISION_SEQ 38 /* returned in BL by int 21 function 30 */ #define REVISION_SEQ 38 /* returned in BL by int 21 function 30 */
#define OEM_ID 0xfd /* FreeDOS, returned in BH by int 21 30 */ #define OEM_ID 0xfd /* FreeDOS, returned in BH by int 21 30 */
#define SOURCE_DATE_STRING "Jul 21 2007" /* DATE OF THE NEWEST SOURCE FILE */ #define SOURCE_DATE_STRING "Jul 28 2007" /* DATE OF THE NEWEST SOURCE FILE */
/* #define KERNEL_VERSION_STRING "1.1.35" formerly used in os_release text */ /* #define KERNEL_VERSION_STRING "1.1.35" formerly used in os_release text */
#define KERNEL_BUILD_STRING "2038pre/2036svn" /* used in os_release string */ #define KERNEL_BUILD_STRING "2038pre/2036svn" /* used in os_release string */

View File

@ -1311,12 +1311,13 @@ dispatch:
CritErrCode = -rc; /* Maybe set */ CritErrCode = -rc; /* Maybe set */
SET_CARRY_FLAG(); SET_CARRY_FLAG();
} }
r->AX = -rc; r->AX = -rc; /* okay because we use real_exit */
goto real_exit; goto real_exit;
} }
case 0x60: /* TRUENAME */ case 0x60: /* TRUENAME */
rc = DosTruename(MK_FP(lr.DS, lr.SI), adjust_far(FP_ES_DI)); rc = DosTruename(MK_FP(lr.DS, lr.SI), adjust_far(FP_ES_DI));
lr.AX = rc;
goto short_check; goto short_check;
#ifdef TSC #ifdef TSC
@ -1562,7 +1563,7 @@ error_exit:
error_carry: error_carry:
SET_CARRY_FLAG(); SET_CARRY_FLAG();
exit_dispatch: exit_dispatch:
fmemcpy(r, &lr, sizeof(lregs) - 4); fmemcpy(r, &lr, sizeof(lregs) - 4); /* copy lr -> r but exclude flags */
r->DS = lr.DS; r->DS = lr.DS;
r->ES = lr.ES; r->ES = lr.ES;
real_exit:; real_exit:;

View File

@ -76,8 +76,10 @@ long DosMkTmp(BYTE FAR * pathname, UWORD attr)
int loop; int loop;
ptmp = pathname + fstrlen(pathname); ptmp = pathname + fstrlen(pathname);
if (os_major == 5) { /* clone some bad habit of MS DOS 5.0 only */
if (ptmp == pathname || (ptmp[-1] != '\\' && ptmp[-1] != '/')) if (ptmp == pathname || (ptmp[-1] != '\\' && ptmp[-1] != '/'))
*ptmp++ = '\\'; *ptmp++ = '\\';
}
ptmp[8] = '\0'; ptmp[8] = '\0';
randvar = ((unsigned long)dos_getdate() << 16) | dos_gettime(); randvar = ((unsigned long)dos_getdate() << 16) | dos_gettime();
@ -352,7 +354,7 @@ COUNT truename(const char FAR * src, char * dest, COUNT mode)
if (cdsEntry->cdsFlags & CDSNETWDRV) if (cdsEntry->cdsFlags & CDSNETWDRV)
result |= IS_NETWORK; result |= IS_NETWORK;
dhp = IsDevice(src); dhp = IsDevice(src); /* returns header if -char- device */
if (dhp) if (dhp)
result |= IS_DEVICE; result |= IS_DEVICE;
@ -605,6 +607,15 @@ COUNT truename(const char FAR * src, char * dest, COUNT mode)
dest[2] != '/' && !dir_exists(dest)) dest[2] != '/' && !dir_exists(dest))
return DE_PATHNOTFND; return DE_PATHNOTFND;
/* Note: Not reached on error or if JOIN or QRemote_Fn (2f.1123) matched */
if (mode==CDS_MODE_ALLOW_WILDCARDS) /* DosTruename mode */
{
/* in other words: result & 0x60 = 0x20...: */
if (os_major==6 && (result & (IS_DEVICE|IS_NETWORK)) == IS_DEVICE)
result = 0x3a00; /* MS DOS 6.22, according to RBIL: AH=3a if char dev */
else
result = 0; /* AL is 00, 2f, 5c, or last-of-cdsEntry->cdsCurrentPath? */
}
tn_printf(("Physical path: \"%s\"\n", dest)); tn_printf(("Physical path: \"%s\"\n", dest));
return result; return result;
} }