• make the "if called as sh, set FPOSIX" not !SMALL-only

• bump to R30-gamma, feature freeze
This commit is contained in:
tg 2007-07-17 13:56:51 +00:00
parent 823f5c2a17
commit 56a8da33cf
3 changed files with 13 additions and 24 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.125 2007/07/06 11:54:34 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.126 2007/07/17 13:56:50 tg 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: 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
expected-stdout:
@(#)MIRBSD KSH R29 2007/07/05
@(#)MIRBSD KSH R30 2007/07/17
description:
Check version of shell.
category: pdksh
@ -4004,7 +4004,7 @@ expected-stdout:
name: aliases-3
description:
Check if running as sh disables built-in aliases (except a few)
category: pdksh,!smksh
category: pdksh
arguments: !-o!posix!
stdin:
cp "$0" sh

27
main.c
View File

@ -13,7 +13,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.82 2007/07/01 21:10:29 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.83 2007/07/17 13:56:51 tg Exp $");
extern char **environ;
@ -63,12 +63,11 @@ static int initio_done;
int
main(int argc, const char *argv[])
{
int i;
int argi;
int argi, i;
Source *s;
struct block *l;
int restricted, errexit;
const char **wp;
const char **wp, *cc;
struct env env;
pid_t ppid;
struct tbl *vp;
@ -77,9 +76,6 @@ main(int argc, const char *argv[])
size_t k;
char *cp;
#endif
#if !defined(MKSH_SMALL) || HAVE_SETLOCALE_CTYPE
const char *cc;
#endif
/* make sure argv[] is sane */
if (!*argv) {
@ -162,21 +158,14 @@ main(int argc, const char *argv[])
/* setstr can't fail here */
setstr(vp, def_path, KSH_RETURN_ERROR);
#ifndef MKSH_SMALL
/* Set FPOSIX if we're called as -sh or /bin/sh or so */
cc = kshname;
if (*cc == '-')
++cc;
i = 0;
i = 0; argi = 0;
while (cc[i] != '\0')
if (cc[i] == '/') {
cc += i + 1;
i = 0;
} else
++i;
if ((cc[0] == 's' || cc[0] == 'S') &&
(cc[1] == 'h' || cc[1] == 'H'))
if ((cc[i++] | 2) == '/')
argi = i;
if (((cc[argi] | 0x20) == 's') && ((cc[argi + 1] | 0x20) == 'h'))
Flag(FPOSIX) = 1;
#endif
/* Turn on nohup by default for now - will change to off
* by default once people are aware of its existence

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: 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.156 2007/07/06 02:22:57 tg Exp $"
#define MKSH_VERSION "R29 2007/07/05"
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.157 2007/07/17 13:56:49 tg Exp $"
#define MKSH_VERSION "R30 2007/07/17"
#if HAVE_SYS_PARAM_H
#include <sys/param.h>