commit 4b64cbff46bfb371186d0dafc0f48efab11c89cb
Author: sin <[email protected]>
Date:   Mon Feb 9 15:52:31 2015 +0000

    tail: Handle tail -n -val properly

diff --git a/tail.c b/tail.c
index e244930..9f5bd4f 100644
--- a/tail.c
+++ b/tail.c
@@ -74,7 +74,8 @@ main(int argc, char *argv[])
                break;
        case 'n':
                lines = EARGF(usage());
-               n = estrtonum(lines, 0, MIN(LLONG_MAX, SIZE_MAX));
+               n = estrtonum(lines[0] == '-' ? lines + 1 : lines,
+                             0, MIN(LLONG_MAX, SIZE_MAX));
                if (lines[0] == '+')
                        tail = dropinit;
                break;

Reply via email to