diff options
author | sandman <sandman@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-05-27 22:24:53 +0000 |
---|---|---|
committer | sandman <sandman@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-05-27 22:24:53 +0000 |
commit | 47122978603b0879fcae3b8af13b8bdfac1e1de4 (patch) | |
tree | c2296e39db1a62fc8d59cf9a64a2f46950b4b63b /coreutils/head.c | |
parent | 2240bede1b1640f3181c68b61fb557b15c396b9f (diff) | |
download | busybox-w32-47122978603b0879fcae3b8af13b8bdfac1e1de4.tar.gz busybox-w32-47122978603b0879fcae3b8af13b8bdfac1e1de4.tar.bz2 busybox-w32-47122978603b0879fcae3b8af13b8bdfac1e1de4.zip |
Added include for isdigit(); simplified -<num> detection
git-svn-id: svn://busybox.net/trunk/busybox@4810 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/head.c')
-rw-r--r-- | coreutils/head.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/coreutils/head.c b/coreutils/head.c index c5c11fc7b..ad21e1b95 100644 --- a/coreutils/head.c +++ b/coreutils/head.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <getopt.h> | 25 | #include <getopt.h> |
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include <string.h> | 27 | #include <string.h> |
28 | #include <ctype.h> | ||
28 | #include "busybox.h" | 29 | #include "busybox.h" |
29 | 30 | ||
30 | static int head(int len, FILE *fp) | 31 | static int head(int len, FILE *fp) |
@@ -47,7 +48,7 @@ int head_main(int argc, char **argv) | |||
47 | FILE *fp; | 48 | FILE *fp; |
48 | int need_headers, opt, len = 10, status = EXIT_SUCCESS; | 49 | int need_headers, opt, len = 10, status = EXIT_SUCCESS; |
49 | 50 | ||
50 | if (( argc >= 2 ) && ( strlen ( argv [1] ) >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) { | 51 | if (( argc >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) { |
51 | len = atoi ( &argv [1][1] ); | 52 | len = atoi ( &argv [1][1] ); |
52 | optind = 2; | 53 | optind = 2; |
53 | } | 54 | } |