Backport upstream patch for proper EOF handling (bugz#1705129)

Conflicts:
	octave.spec
This commit is contained in:
Orion Poplawski 2019-05-06 21:47:37 -06:00
parent 4d71e9d666
commit 6d9787ef24
2 changed files with 37 additions and 0 deletions

28
octave-eof.patch Normal file
View File

@ -0,0 +1,28 @@
# HG changeset patch
# User Mike Miller <mtmiller@octave.org>
# Date 1554238576 25200
# Node ID c3716220d5b93c49e1c7cc8ebe0b76dd961f4ec7
# Parent fc73dafece570f201c18a4eb4a8729a654cfcfbb
fix pause and kbhit with glibc 2.28 end-of-file state behavior (bug #55029)
* sysdep.cc (octave::kbhit): Call "clearerr (stdin)" on end-of-file condition
in addition to "std::cin.clear ()". In glibc 2.28, end-of-file is persistent
and must be cleared by the application.
diff --git a/libinterp/corefcn/sysdep.cc b/libinterp/corefcn/sysdep.cc
--- a/libinterp/corefcn/sysdep.cc
+++ b/libinterp/corefcn/sysdep.cc
@@ -566,7 +566,10 @@
int c = std::cin.get ();
if (std::cin.fail () || std::cin.eof ())
- std::cin.clear ();
+ {
+ std::cin.clear ();
+ clearerr (stdin);
+ }
// Restore it, enabling system call restarts (if possible).
octave::set_interrupt_handler (saved_interrupt_handler, true);

View File

@ -37,6 +37,10 @@ Source3: octave-5.1.0-docs.tar.lz
# SUNDIALS 3 support
# https://savannah.gnu.org/bugs/?52475
Patch1: octave-sundials3.patch
# Proper EOF handling
# https://bugzilla.redhat.com/show_bug.cgi?id=1705129
# https://hg.savannah.gnu.org/hgweb/octave/rev/c3716220d5b9
Patch2: octave-eof.patch
Provides: octave(api) = %{octave_api}
Provides: bundled(gnulib)
@ -199,6 +203,7 @@ This package contains documentation for Octave.
%prep
%setup -q -n %{name}-%{version}%{?rctag}
%patch2 -p1 -b .eof
# EPEL7's autoconf/automake is too old so don't do
# unneeded patches there
%if 0%{?fedora}
@ -405,6 +410,10 @@ make check %{?el7:|| :}
%{_pkgdocdir}/refcard*.pdf
%changelog
* Mon May 6 2019 Orion Poplawski <orion@nwra.com> - 6:5.1.0-1
- Update to 5.1.0
- Add upstream patch for proper EOF handling (bugz#1705129)
* Thu Mar 7 2019 Tim Landscheidt <tim@tim-landscheidt.de> - 6:4.4.1-5
- Remove obsolete requirements for post/preun scriptlets