diff --git a/octave-eof.patch b/octave-eof.patch new file mode 100644 index 0000000..f2c90bb --- /dev/null +++ b/octave-eof.patch @@ -0,0 +1,28 @@ + +# HG changeset patch +# User Mike Miller +# 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); + diff --git a/octave.spec b/octave.spec index 6f79ca5..6723489 100644 --- a/octave.spec +++ b/octave.spec @@ -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 - 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 - 6:4.4.1-5 - Remove obsolete requirements for post/preun scriptlets