From 5f13019d058edbfdc85d4c457b9788a2bc5d08b9 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 15 Mar 2012 20:20:08 -0400 Subject: [PATCH] Ubuntu 'select' Fix - Added a delay before the 'select' call on STDIN, to allow time for the data to buffer. Experimental patch. --- src/A3.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/A3.cpp b/src/A3.cpp index 5f334e7f8..a6aaa9846 100644 --- a/src/A3.cpp +++ b/src/A3.cpp @@ -279,6 +279,9 @@ bool A3::is_command ( // Add an Arg for every word from std::cin. void A3::append_stdin () { + // Delay, to give it a chance to buffer the input. + delay (0.01); + // Use 'select' to determine whether there is any std::cin content buffered // before trying to read it, to prevent blocking. struct timeval tv;