changeset 27012:762bfd9fad94

maint: merge stable to default
author Mike Miller <mtmiller@octave.org>
date Tue, 02 Apr 2019 15:02:19 -0700
parents b6d826339138 (current diff) c3716220d5b9 (diff)
children b37c1656aa42
files libinterp/corefcn/sysdep.cc
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/sysdep.cc	Mon Apr 01 14:48:26 2019 -0700
+++ b/libinterp/corefcn/sysdep.cc	Tue Apr 02 15:02:19 2019 -0700
@@ -617,7 +617,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);