diff options
author | Rob Landley <rob@landley.net> | 2005-12-16 08:02:11 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2005-12-16 08:02:11 +0000 |
commit | 4b91b88fcb73e928415bda80090b98b2d3806ff1 (patch) | |
tree | 9adebb373ca5d8199ce96634dc960a4e50c7ad4b /miscutils/less.c | |
parent | 199501f2a00956265a5dba74ea01badab6c331ac (diff) | |
download | busybox-w32-4b91b88fcb73e928415bda80090b98b2d3806ff1.tar.gz busybox-w32-4b91b88fcb73e928415bda80090b98b2d3806ff1.tar.bz2 busybox-w32-4b91b88fcb73e928415bda80090b98b2d3806ff1.zip |
Less would segfault if it had no tty. (Bug 600.)
Diffstat (limited to 'miscutils/less.c')
-rw-r--r-- | miscutils/less.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/miscutils/less.c b/miscutils/less.c index 0b0dc0c8b..19051f6f6 100644 --- a/miscutils/less.c +++ b/miscutils/less.c | |||
@@ -239,6 +239,7 @@ static void data_readlines(void) { | |||
239 | 239 | ||
240 | if(inp == NULL) | 240 | if(inp == NULL) |
241 | inp = (inp_stdin) ? bb_xfopen(CURRENT_TTY, "r") : stdin; | 241 | inp = (inp_stdin) ? bb_xfopen(CURRENT_TTY, "r") : stdin; |
242 | if(inp == NULL) bb_perror_msg_and_die("no tty"); | ||
242 | 243 | ||
243 | if (flags & FLAG_N) | 244 | if (flags & FLAG_N) |
244 | add_linenumbers(); | 245 | add_linenumbers(); |