diff options
-rw-r--r-- | bin/ksh/main.c | 8 | ||||
-rw-r--r-- | bin/ksh/var.c | 10 | ||||
-rw-r--r-- | distrib/special/ksh/Makefile | 4 |
3 files changed, 18 insertions, 4 deletions
diff --git a/bin/ksh/main.c b/bin/ksh/main.c index 5ab581ecaaf..b011b22bfc0 100644 --- a/bin/ksh/main.c +++ b/bin/ksh/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.99 2023/02/08 17:22:10 kn Exp $ */ +/* $OpenBSD: main.c,v 1.100 2023/07/23 23:42:03 kn Exp $ */ /* * startup, main loop, environments and error handling @@ -87,7 +87,11 @@ static const char *initcoms [] = { "typeset", "-x", "SHELL", "PATH", "HOME", "PWD", "OLDPWD", NULL, "typeset", "-ir", "PPID", NULL, "typeset", "-i", "OPTIND=1", NULL, +#ifndef SMALL "eval", "typeset -i RANDOM MAILCHECK=\"${MAILCHECK-600}\" SECONDS=\"${SECONDS-0}\" TMOUT=\"${TMOUT-0}\"", NULL, +#else + "eval", "typeset -i RANDOM SECONDS=\"${SECONDS-0}\" TMOUT=\"${TMOUT-0}\"", NULL, +#endif /* SMALL */ "alias", /* Standard ksh aliases */ "hash=alias -t", /* not "alias -t --": hash -r needs to work */ @@ -615,7 +619,9 @@ shell(Source *volatile s, volatile int toplevel) if (interactive) { got_sigwinch = 1; j_notify(); +#ifndef SMALL mcheck(); +#endif /* SMALL */ set_prompt(PS1); } diff --git a/bin/ksh/var.c b/bin/ksh/var.c index 9dbba073166..0757440ed66 100644 --- a/bin/ksh/var.c +++ b/bin/ksh/var.c @@ -1,4 +1,4 @@ -/* $OpenBSD: var.c,v 1.72 2021/03/05 15:22:03 zhuk Exp $ */ +/* $OpenBSD: var.c,v 1.73 2023/07/23 23:42:03 kn Exp $ */ #include <sys/stat.h> #include <sys/time.h> @@ -108,9 +108,11 @@ initvar(void) { "HISTSIZE", V_HISTSIZE }, { "EDITOR", V_EDITOR }, { "VISUAL", V_VISUAL }, +#ifndef SMALL { "MAIL", V_MAIL }, { "MAILCHECK", V_MAILCHECK }, { "MAILPATH", V_MAILPATH }, +#endif /* SMALL */ { "RANDOM", V_RANDOM }, { "SECONDS", V_SECONDS }, { "TMOUT", V_TMOUT }, @@ -1029,6 +1031,7 @@ setspec(struct tbl *vp) x_cols = l; } break; +#ifndef SMALL case V_MAIL: mbset(str_val(vp)); break; @@ -1040,6 +1043,7 @@ setspec(struct tbl *vp) mcset(intval(vp)); vp->flag |= SPECIAL; break; +#endif /* SMALL */ case V_RANDOM: vp->flag &= ~SPECIAL; srand_deterministic((unsigned int)intval(vp)); @@ -1099,17 +1103,21 @@ unsetspec(struct tbl *vp) afree(tmpdir, APERM); tmpdir = NULL; break; +#ifndef SMALL case V_MAIL: mbset(NULL); break; case V_MAILPATH: mpset(NULL); break; +#endif /* SMALL */ case V_HISTCONTROL: sethistcontrol(NULL); break; case V_LINENO: +#ifndef SMALL case V_MAILCHECK: /* at&t ksh leaves previous value in place */ +#endif /* SMALL */ case V_RANDOM: case V_SECONDS: case V_TMOUT: /* at&t ksh leaves previous value in place */ diff --git a/distrib/special/ksh/Makefile b/distrib/special/ksh/Makefile index 9aced4e29ca..c4b76dbc69b 100644 --- a/distrib/special/ksh/Makefile +++ b/distrib/special/ksh/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.6 2023/02/08 17:22:10 kn Exp $ +# $OpenBSD: Makefile,v 1.7 2023/07/23 23:42:03 kn Exp $ PROG= ksh SRCS= alloc.c c_ksh.c c_sh.c c_test.c c_ulimit.c edit.c emacs.c eval.c \ - exec.c expr.c history.c io.c jobs.c lex.c mail.c main.c \ + exec.c expr.c history.c io.c jobs.c lex.c main.c \ misc.c path.c shf.c syn.c table.c trap.c tree.c tty.c var.c \ vi.c |