From d6aff89bbb0ff229351ba76d85bd6728bc8f366b Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 30 Mar 2015 21:24:46 +0200 Subject: [PATCH] tail: allow tail -n 0 or tail -0 fix a crash, but allow this option. --- tail.c | 3 +++ tr.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tail.c b/tail.c index 6d02914..888dd47 100644 --- a/tail.c +++ b/tail.c @@ -106,6 +106,9 @@ main(int argc, char *argv[]) usage(); } ARGEND; + if (!num) + return 0; + if (!argc) tail(stdin, ""); else { diff --git a/tr.c b/tr.c index 3d067bc..5dcc307 100644 --- a/tr.c +++ b/tr.c @@ -39,7 +39,6 @@ static struct range *set2 = NULL; static size_t set2ranges = 0; static int (*set2check)(Rune) = NULL; - static size_t rangelen(struct range r) {