diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-23 14:58:14 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-23 14:58:14 +0000 |
| commit | 4b5709496bb00301f4df6a8e3c0ced23b4d36603 (patch) | |
| tree | aae6724fa14d2533e34d9ed0ec582ea2a06ea521 /miscutils | |
| parent | 4c83025ea6fd8ccc450f822e87da0e1187d62aca (diff) | |
| download | busybox-w32-4b5709496bb00301f4df6a8e3c0ced23b4d36603.tar.gz busybox-w32-4b5709496bb00301f4df6a8e3c0ced23b4d36603.tar.bz2 busybox-w32-4b5709496bb00301f4df6a8e3c0ced23b4d36603.zip | |
strings: code shrink -22 bytes by Tito
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/strings.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/miscutils/strings.c b/miscutils/strings.c index 3e02b53af..fea9edbed 100644 --- a/miscutils/strings.c +++ b/miscutils/strings.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | /* | 2 | /* |
| 3 | * strings implementation for busybox | 3 | * strings implementation for busybox |
| 4 | * | 4 | * |
| 5 | * Copyright Tito Ragusa <farmatito@tiscali.it> | 5 | * Copyright 2003 Tito Ragusa <farmatito@tiscali.it> |
| 6 | * | 6 | * |
| 7 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. | 7 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
| 8 | */ | 8 | */ |
| @@ -18,7 +18,6 @@ int strings_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | |||
| 18 | int strings_main(int argc UNUSED_PARAM, char **argv) | 18 | int strings_main(int argc UNUSED_PARAM, char **argv) |
| 19 | { | 19 | { |
| 20 | int n, c, status = EXIT_SUCCESS; | 20 | int n, c, status = EXIT_SUCCESS; |
| 21 | unsigned opt; | ||
| 22 | unsigned count; | 21 | unsigned count; |
| 23 | off_t offset; | 22 | off_t offset; |
| 24 | FILE *file; | 23 | FILE *file; |
| @@ -26,7 +25,7 @@ int strings_main(int argc UNUSED_PARAM, char **argv) | |||
| 26 | const char *fmt = "%s: "; | 25 | const char *fmt = "%s: "; |
| 27 | const char *n_arg = "4"; | 26 | const char *n_arg = "4"; |
| 28 | 27 | ||
| 29 | opt = getopt32(argv, "afon:", &n_arg); | 28 | getopt32(argv, "afon:", &n_arg); |
| 30 | /* -a is our default behaviour */ | 29 | /* -a is our default behaviour */ |
| 31 | /*argc -= optind;*/ | 30 | /*argc -= optind;*/ |
| 32 | argv += optind; | 31 | argv += optind; |
| @@ -56,10 +55,10 @@ int strings_main(int argc UNUSED_PARAM, char **argv) | |||
| 56 | } else { | 55 | } else { |
| 57 | string[count] = c; | 56 | string[count] = c; |
| 58 | if (count == n) { | 57 | if (count == n) { |
| 59 | if (opt & PRINT_NAME) { | 58 | if (option_mask32 & PRINT_NAME) { |
| 60 | printf(fmt, *argv); | 59 | printf(fmt, *argv); |
| 61 | } | 60 | } |
| 62 | if (opt & PRINT_OFFSET) { | 61 | if (option_mask32 & PRINT_OFFSET) { |
| 63 | printf("%7"OFF_FMT"o ", offset - n); | 62 | printf("%7"OFF_FMT"o ", offset - n); |
| 64 | } | 63 | } |
| 65 | fputs(string, stdout); | 64 | fputs(string, stdout); |
