we don't need to be special if called as -sh any longer now

This commit is contained in:
tg 2008-03-01 02:21:38 +00:00
parent f87b33997a
commit 36c4552e1f
4 changed files with 8 additions and 19 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.151 2008/02/29 16:38:40 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.152 2008/03/01 02:21:36 tg Stab $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -7,7 +7,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh # http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout: expected-stdout:
@(#)MIRBSD KSH R33 2008/02/27 @(#)MIRBSD KSH R33 2008/03/01
description: description:
Check version of shell. Check version of shell.
category: pdksh category: pdksh

13
main.c
View File

@ -13,7 +13,7 @@
#include <locale.h> #include <locale.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.90 2008/02/25 00:58:26 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/main.c,v 1.91 2008/03/01 02:21:37 tg Exp $");
extern char **environ; extern char **environ;
@ -64,7 +64,7 @@ main(int argc, const char *argv[])
Source *s; Source *s;
struct block *l; struct block *l;
int restricted, errexit; int restricted, errexit;
const char **wp, *cc; const char **wp;
struct env env; struct env env;
pid_t ppid; pid_t ppid;
struct tbl *vp; struct tbl *vp;
@ -173,15 +173,6 @@ main(int argc, const char *argv[])
Flag(FVITABCOMPLETE) = 1; Flag(FVITABCOMPLETE) = 1;
#endif #endif
/* Set FPOSIX if we're called as -sh or /bin/sh or so */
cc = kshname;
i = 0; argi = 0;
while (cc[i] != '\0')
if ((cc[i++] | 2) == '/')
argi = i;
if (((cc[argi] | 0x20) == 's') && ((cc[argi + 1] | 0x20) == 'h'))
change_flag(FPOSIX, OF_FIRSTTIME, 1);
/* import environment */ /* import environment */
if (environ != NULL) if (environ != NULL)
for (wp = (const char **)environ; *wp != NULL; wp++) for (wp = (const char **)environ; *wp != NULL; wp++)

6
mksh.1
View File

@ -1,4 +1,4 @@
.\" $MirOS: src/bin/mksh/mksh.1,v 1.110 2008/02/29 18:20:16 tg Exp $ .\" $MirOS: src/bin/mksh/mksh.1,v 1.111 2008/03/01 02:21:37 tg Exp $
.\" $OpenBSD: ksh.1,v 1.120 2007/05/31 20:47:44 otto Exp $ .\" $OpenBSD: ksh.1,v 1.120 2007/05/31 20:47:44 otto Exp $
.\" .\"
.\" Implement .Dd with the Mdocdate RCS keyword .\" Implement .Dd with the Mdocdate RCS keyword
@ -10,7 +10,7 @@
.el .xD \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 .el .xD \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
.. ..
.\"- .\"-
.Dd $Mdocdate: February 29 2008 $ .Dd $Mdocdate: March 1 2008 $
.Dt MKSH 1 .Dt MKSH 1
.Os MirBSD .Os MirBSD
.Sh NAME .Sh NAME
@ -3490,8 +3490,6 @@ and
commands above for more details. commands above for more details.
.It Ic posix .It Ic posix
Enable POSIX mode. Enable POSIX mode.
Automatically enabled if the basename of the shell invocation begins with
.Dq sh .
Currently, this just turns off Currently, this just turns off
.Ic braceexpand .Ic braceexpand
mode when turned on, which can be turned back on manually. mode when turned on, which can be turned back on manually.

4
sh.h
View File

@ -8,8 +8,8 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.190 2008/02/27 12:49:54 tg Exp $" #define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.191 2008/03/01 02:21:38 tg Rel $"
#define MKSH_VERSION "R33 2008/02/27" #define MKSH_VERSION "R33 2008/03/01"
#if HAVE_SYS_PARAM_H #if HAVE_SYS_PARAM_H
#include <sys/param.h> #include <sys/param.h>