From bug-octave-request at bevo dot che dot wisc dot edu Thu Jan 28 21:45:55 1999 Subject: pause does not flush buffers when used with echo on From: "John W. Eaton" To: Arno Peters Cc: bug-octave at bevo dot che dot wisc dot edu Date: Thu, 28 Jan 1999 21:45:47 -0600 (CST) On 29-Jan-1999, Arno Peters wrote: | pause does not flush the buffers when used in conjuction with echo on. | | Repeat-By: | --------- | | Run the following small script: | ---- begin script | echo on | ## A little script to show how pause does not flush the buffers. | pause | | ## And another line just to be sure | pause | echo off | ---- end script | | The script will not output anything until after two keypresses. Please try the following patch. Thanks, jwe Thu Jan 28 21:29:16 1999 John W. Eaton * sysdep.cc (Fpause): Flush output before getting user input. Index: sysdep.cc =================================================================== RCS file: /home/jwe/src/master/octave/src/sysdep.cc,v retrieving revision 1.86 diff -c -r1.86 sysdep.cc *** sysdep.cc 1997/12/12 04:01:56 1.86 --- sysdep.cc 1999/01/29 03:30:02 *************** *** 75,80 **** --- 75,81 ---- #include "input.h" #include "oct-obj.h" #include "ov.h" + #include "pager.h" #include "sysdep.h" #include "toplev.h" #include "utils.h" *************** *** 414,420 **** if (xisnan (dval)) warning ("pause: NaN is an invalid delay"); else if (xisinf (dval)) ! kbhit (); else { int delay = NINT (dval); --- 415,424 ---- if (xisnan (dval)) warning ("pause: NaN is an invalid delay"); else if (xisinf (dval)) ! { ! flush_octave_stdout (); ! kbhit (); ! } else { int delay = NINT (dval); *************** *** 424,430 **** } } else ! kbhit (); return retval; } --- 428,437 ---- } } else ! { ! flush_octave_stdout (); ! kbhit (); ! } return retval; }