From be280a1c771f850440db558ed7f3d07ce3b76a66 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 6 May 2019 21:47:37 -0600 Subject: [PATCH] Backport upstream patch for proper EOF handling (bugz#1705129) --- octave-eof.patch | 15 +++++++++++++++ octave.spec | 10 +++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 octave-eof.patch diff --git a/octave-eof.patch b/octave-eof.patch new file mode 100644 index 0000000..1121242 --- /dev/null +++ b/octave-eof.patch @@ -0,0 +1,15 @@ +diff -up octave-4.4.1/libinterp/corefcn/sysdep.cc.eof octave-4.4.1/libinterp/corefcn/sysdep.cc +--- octave-4.4.1/libinterp/corefcn/sysdep.cc.eof 2019-05-06 21:43:06.906724728 -0600 ++++ octave-4.4.1/libinterp/corefcn/sysdep.cc 2019-05-06 21:44:58.445306461 -0600 +@@ -559,7 +559,10 @@ octave_kbhit (bool wait) + 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 9202710..61425be 100644 --- a/octave.spec +++ b/octave.spec @@ -22,7 +22,7 @@ Name: octave Epoch: 6 Version: 4.4.1 -Release: 7%{?relsuf}%{?dist} +Release: 8%{?relsuf}%{?dist} Summary: A high-level language for numerical computations License: GPLv3+ URL: http://www.octave.org @@ -43,6 +43,10 @@ Patch0: octave-crash.patch # 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) @@ -210,6 +214,7 @@ This package contains documentation for Octave. %prep %setup -q -n %{name}-%{version}%{?rctag} %patch0 -p1 -b .crash +%patch2 -p1 -b .eof # EPEL7's autoconf/automake is too old so don't do # unneeded patches there %if 0%{?fedora} @@ -428,6 +433,9 @@ make check %{_pkgdocdir}/refcard*.pdf %changelog +* Mon May 6 2019 Orion Poplawski - 6:4.4.1-8 +- Backport upstream patch for proper EOF handling (bugz#1705129) + * Tue Apr 23 2019 Björn Esser - 6:4.4.1-7 - rebuilt (sundials)