| * strings implementation for busybox |
| * Copyright 2003 Tito Ragusa <farmatito@tiscali.it> |
| * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
| int strings_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| int strings_main(int argc UNUSED_PARAM, char **argv) |
| int n, c, status = EXIT_SUCCESS; |
| const char *fmt = "%s: "; |
| getopt32(argv, "afon:", &n_arg); |
| /* -a is our default behaviour */ |
| n = xatou_range(n_arg, 1, INT_MAX); |
| *--argv = (char *)bb_msg_standard_input; |
| file = fopen_or_warn_stdin(*argv); |
| if (isprint_asciionly(c) || c == '\t') { |
| if (option_mask32 & PRINT_NAME) { |
| if (option_mask32 & PRINT_OFFSET) { |
| printf("%7"OFF_FMT"o ", offset - n); |
| fclose_if_not_stdin(file); |
| if (ENABLE_FEATURE_CLEAN_UP) |
| fflush_stdout_and_exit(status); |