Less would segfault if it had no tty. (Bug 600.)

This commit is contained in:
Rob Landley 2005-12-16 08:02:11 +00:00
parent 199501f2a0
commit 4b91b88fcb

View File

@ -239,6 +239,7 @@ static void data_readlines(void) {
if(inp == NULL)
inp = (inp_stdin) ? bb_xfopen(CURRENT_TTY, "r") : stdin;
if(inp == NULL) bb_perror_msg_and_die("no tty");
if (flags & FLAG_N)
add_linenumbers();