tail: Handle tail -n -val properly
This commit is contained in:
parent
a5cc60f2e0
commit
f802a544e7
3
tail.c
3
tail.c
@ -74,7 +74,8 @@ main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
lines = EARGF(usage());
|
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] == '+')
|
if (lines[0] == '+')
|
||||||
tail = dropinit;
|
tail = dropinit;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user