fix regression w.r.t. TTY and external programmes:

• release the TTY after the initial change_winsz()
• since we release it, we can skip initialising tty_state, too
This commit is contained in:
tg 2012-03-25 14:28:14 +00:00
parent 5dd5edea1a
commit 87654270ab
3 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.520 2012/03/24 21:22:23 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.521 2012/03/25 14:28:11 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 $
@ -29,7 +29,7 @@
# http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD
expected-stdout:
@(#)MIRBSD KSH R40 2012/03/24
@(#)MIRBSD KSH R40 2012/03/25
description:
Check version of shell.
stdin:

5
main.c
View File

@ -34,7 +34,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.210 2012/03/24 22:11:41 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.211 2012/03/25 14:28:14 tg Exp $");
extern char **environ;
@ -252,8 +252,9 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
#ifdef TIOCGWINSZ
/* try to initialise tty size before importing environment */
tty_init(true, false);
tty_init(false, false);
change_winsz();
tty_close();
#endif
#ifdef _PATH_DEFPATH

4
sh.h
View File

@ -152,9 +152,9 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.527 2012/03/24 21:22:25 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.528 2012/03/25 14:28:14 tg Exp $");
#endif
#define MKSH_VERSION "R40 2012/03/24"
#define MKSH_VERSION "R40 2012/03/25"
/* arithmetic types: C implementation */
#if !HAVE_CAN_INTTYPES