[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55943] pause() with no arguments returns imme

From: Mike Miller
Subject: [Octave-bug-tracker] [bug #55943] pause() with no arguments returns immediately on Windows
Date: Fri, 29 Mar 2019 00:22:16 -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 #16, bug #55943 (project octave):

I have a suspicion about this bug. It's Windows specific, which means it may
be caused by the Windows specific section of code here:


Now I don't really know how these functions work on Windows, but it looks to
me like in non-blocking mode, it's either returning a valid character or the
value 0 if no keys were pressed.

Can someone please test a patch on Windows that simply returns -1 instead of 0
in that ternary expression?

In the Unix section of code, the return value when no character is available
is 'EOF', which is defined to be -1 in stdio.h.

Meanwhile, in the new 'octave::sleep(inf)' section of code that was added in
Octave 5.1, 'octave::kbhit' is called in a loop, and any non-negative value,
including 0, breaks out of the loop. So that may explain why this returns
immediately on Windows.



Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]