[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55029] pause() with no arguments does not ret
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28 |
Date: |
Thu, 28 Mar 2019 20:32:20 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36 |
Follow-up Comment #62, bug #55029 (project octave):
This patch also works for me, and maybe is a bit clearer since it groups the
'std::cin' along with the 'clearerr (stdin)':
--- a/libinterp/corefcn/sysdep.cc
+++ b/libinterp/corefcn/sysdep.cc
@@ -617,7 +617,10 @@ namespace octave
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);
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55029>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28, Mike Miller, 2019/03/27
- [Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28, Pantxo Diribarne, 2019/03/28
- [Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28, Mike Miller, 2019/03/28
- [Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28, Rik, 2019/03/28
- [Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28, Mike Miller, 2019/03/28
- [Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28, Mike Miller, 2019/03/28
- [Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28, Rik, 2019/03/28
- [Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28,
Mike Miller <=
- [Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28, Pantxo Diribarne, 2019/03/29