summaryrefslogtreecommitdiff
path: root/coreutils/tail.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/tail.c')
-rw-r--r--coreutils/tail.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 0c8dec2..8201c80 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -68,6 +68,11 @@ int tail_main(int argc, char **argv)
char *s, *start, *end, buf[BUFSIZ];
int i, opt;
+ if (( argc >= 2 ) && ( strlen ( argv [1] ) >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) {
+ count = atoi ( &argv [1][1] );
+ optind = 2;
+ }
+
while ((opt = getopt(argc, argv, "c:fhn:q:s:v")) > 0) {
switch (opt) {
case 'f':