TS-29: tasksh hangs trying to read task from stdin

- Thanks to ilove zfs.
This commit is contained in:
Paul Beckingham 2016-09-06 08:15:21 -04:00
parent 870881a61c
commit cc357231b3
3 changed files with 10 additions and 3 deletions

View file

@ -30,6 +30,7 @@
#include <string>
#include <cstring>
#include <stdlib.h>
#include <unistd.h>
#include <shared.h>
#ifdef HAVE_READLINE
@ -125,6 +126,8 @@ static int commandLoop (bool autoClear)
// cause the shell to terminate.
}
}
else
status = 1;
return status;
}
@ -155,7 +158,9 @@ int main (int argc, const char** argv)
output == "yes\n" ||
output == "on\n");
welcome ();
if (isatty (fileno (stdin)))
welcome ();
while ((status = commandLoop (autoClear)) == 0)
;
}