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: 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 $
@ -29,7 +29,7 @@
# http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD # http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD
expected-stdout: expected-stdout:
@(#)MIRBSD KSH R40 2012/03/24 @(#)MIRBSD KSH R40 2012/03/25
description: description:
Check version of shell. Check version of shell.
stdin: stdin:

5
main.c
View File

@ -34,7 +34,7 @@
#include <locale.h> #include <locale.h>
#endif #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; extern char **environ;
@ -252,8 +252,9 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
#ifdef TIOCGWINSZ #ifdef TIOCGWINSZ
/* try to initialise tty size before importing environment */ /* try to initialise tty size before importing environment */
tty_init(true, false); tty_init(false, false);
change_winsz(); change_winsz();
tty_close();
#endif #endif
#ifdef _PATH_DEFPATH #ifdef _PATH_DEFPATH

4
sh.h
View File

@ -152,9 +152,9 @@
#endif #endif
#ifdef EXTERN #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 #endif
#define MKSH_VERSION "R40 2012/03/24" #define MKSH_VERSION "R40 2012/03/25"
/* arithmetic types: C implementation */ /* arithmetic types: C implementation */
#if !HAVE_CAN_INTTYPES #if !HAVE_CAN_INTTYPES