summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class6
1 files changed, 5 insertions, 1 deletions
diff --git a/it.class b/it.class
index a6e387b..b3505ea 100644
--- a/it.class
+++ b/it.class
@@ -932,7 +932,6 @@ static function getopt($usage, $p = array())
it_debug::set($result['debug']);
$GLOBALS['it_stdin']['args'] = $result['args'] ? $result['args'] : array("-");
- it::_stdin_next();
if ($result['verbose'])
$GLOBALS['debug_verbose']++;
@@ -959,6 +958,11 @@ static function _stdin_next()
*/
static function gets()
{
+ static $initialized = 0;
+
+ if (!$initialized++)
+ it::_stdin_next();
+
do {
$result = fgets($GLOBALS['it_stdin']['fd']);
} while (($result === false) && it::_stdin_next());