don't set KSH_VERSION if invoked as sh

This commit is contained in:
tg 2004-12-31 17:15:07 +00:00
parent 791337c8a3
commit 0799af5fdb
2 changed files with 6 additions and 11 deletions

11
main.c
View File

@ -1,4 +1,4 @@
/** $MirBSD: src/bin/ksh/main.c,v 2.13 2004/12/28 22:40:40 tg Exp $ */
/** $MirBSD: src/bin/ksh/main.c,v 2.14 2004/12/31 17:15:07 tg Exp $ */
/* $OpenBSD: main.c,v 1.35 2004/12/22 18:57:28 otto Exp $ */
/*
@ -15,7 +15,7 @@
* shell version
*/
__RCSID("$MirBSD: src/bin/ksh/main.c,v 2.13 2004/12/28 22:40:40 tg Exp $");
__RCSID("$MirBSD: src/bin/ksh/main.c,v 2.14 2004/12/31 17:15:07 tg Exp $");
const char ksh_version[] =
"@(#)PD KSH v5.2.14 MirOS R20 in "
@ -231,12 +231,11 @@ main(int argc, char *argv[])
setstr(pwd_v, current_wd, KSH_RETURN_ERROR);
}
ppid = getppid();
rnd_seed( (*((long *)kshname)) ^ ((long)time(NULL) * kshpid * ppid) );
setint(global("PPID"), (long) ppid);
rnd_seed( (*((long *)kshname))
^ ((long) (time(NULL) * kshpid * ppid)) );
setint(global("RANDOM"), rnd_get());
/* setstr can't fail here */
setstr(global("KSH_VERSION"), ksh_version, KSH_RETURN_ERROR);
if (!Flag(FSH))
setstr(global("KSH_VERSION"), ksh_version, KSH_RETURN_ERROR);
/* execute initialization statements */
for (wp = (char**) initcoms; *wp != NULL; wp++) {

View File

@ -1,4 +1,4 @@
.\" $MirBSD: src/bin/ksh/sh.1tbl,v 2.3 2004/12/13 19:47:25 tg Exp $
.\" $MirBSD: src/bin/ksh/sh.1tbl,v 2.4 2004/12/31 17:15:07 tg Exp $
.\" _MirBSD: src/bin/ksh/ksh.1tbl,v 2.5 2004/12/13 19:36:27 tg Exp $
.\" $OpenBSD: ksh.1tbl,v 1.79 2004/12/04 07:05:13 jaredy Exp $
.\" $OpenBSD: sh.1tbl,v 1.53 2004/12/10 01:56:56 jaredy Exp $
@ -1254,10 +1254,6 @@ above for details.
.Sy Note:
This parameter is not imported from the environment when the shell is
started.
.It Ev SH_VERSION
The version of
.Nm
(read-only).
.It Ev LINENO
The line number of the function or shell script that is currently being
executed.