diff options
author | Robert Griebl <griebl@gmx.de> | 2002-05-18 02:18:04 +0400 |
---|---|---|
committer | Robert Griebl <griebl@gmx.de> | 2002-05-18 02:18:04 +0400 |
commit | 13c26fc1a55df2b97062cf370547c4d656e70957 (patch) | |
tree | a948e20b6776ca384779aee363db04c02e541be7 /coreutils/tail.c | |
parent | c30c5e89cfe9840745a48a50203b3c4fb76c7773 (diff) |
SUpport old style -[::digit::] options for head and tail
Also make head behave like GNU head (-0/-n 0 is valid)
Diffstat (limited to 'coreutils/tail.c')
-rw-r--r-- | coreutils/tail.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/coreutils/tail.c b/coreutils/tail.c index 0c8dec26a..8201c80a0 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': |