From 869fbb9ef91093330105a026cde02ad24736c2a9 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Fri, 26 Mar 2010 13:36:45 +0000 Subject: [PATCH] - restore tty settings after timed out read for utf-8 locale --- ksh-20100309-restoretty.patch | 15 +++++++++++++++ ksh.spec | 9 ++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 ksh-20100309-restoretty.patch diff --git a/ksh-20100309-restoretty.patch b/ksh-20100309-restoretty.patch new file mode 100644 index 0000000..6e3a5ea --- /dev/null +++ b/ksh-20100309-restoretty.patch @@ -0,0 +1,15 @@ +The ed_viread method is used for reading when locale has an encoding that uses +wide characters (utf8 for example). So we need to cook the raw'ed terminal +before exit, otherwise we end up with a terminal that cannot echo. + +--- a/src/cmd/ksh93/sh/fault.c 2010-01-18 21:41:18.000000000 +0530 ++++ b/src/cmd/ksh93/sh/fault.c 2010-03-10 21:23:56.000000000 +0530 +@@ -614,7 +614,7 @@ void sh_done(void *ptr, register int sig + sh_accend(); + #endif /* SHOPT_ACCT */ + #if SHOPT_VSH || SHOPT_ESH +- if(sh_isoption(SH_EMACS)||sh_isoption(SH_VI)||sh_isoption(SH_GMACS)) ++ if(sh_isoption(mbwide()||SH_EMACS)||sh_isoption(SH_VI)||sh_isoption(SH_GMACS)) + tty_cooked(-1); + #endif + #ifdef JOBS diff --git a/ksh.spec b/ksh.spec index b235e5d..4c1bea5 100644 --- a/ksh.spec +++ b/ksh.spec @@ -6,7 +6,7 @@ URL: http://www.kornshell.com/ Group: System Environment/Shells License: CPL Version: 20100309 -Release: 1%{?dist} +Release: 2%{?dist} Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz Source3: kshrc.rhs @@ -18,6 +18,9 @@ Patch1: ksh-20070328-builtins.patch #435159 - check if there is looped list Patch2: ksh-20090630-jlist.patch +#sent upstream, 572291 - tty settings not restored after timed out read for utf-8 locale +Patch3: ksh-20100309-restoretty.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Conflicts: pdksh Requires: coreutils, glibc-common, diffutils @@ -36,6 +39,7 @@ with "sh" (the Bourne Shell). %setup -q -T -D -a 1 %patch1 -p1 -b .builtins %patch2 -p1 -b .jlist +%patch3 -p1 -b .restoretty #/dev/fd test does not work because of mock sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options @@ -91,6 +95,9 @@ fi rm -rf $RPM_BUILD_ROOT %changelog +* Fri Mar 26 2010 Michal Hlavinka - 20100309-2 +- restore tty settings after timed out read for utf-8 locale + * Wed Mar 10 2010 Michal Hlavinka - 20100309-1 - updated to 2010-03-09 - fix mock building - detection of /dev/fd/X