- restore tty settings after timed out read for utf-8 locale

This commit is contained in:
Michal Hlavinka 2010-03-26 13:36:45 +00:00
parent 9577e684fb
commit 869fbb9ef9
2 changed files with 23 additions and 1 deletions

View File

@ -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

View File

@ -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 <mhlavink@redhat.com> - 20100309-2
- restore tty settings after timed out read for utf-8 locale
* Wed Mar 10 2010 Michal Hlavinka <mhlavink@redhat.com> - 20100309-1
- updated to 2010-03-09
- fix mock building - detection of /dev/fd/X