diff options
Diffstat (limited to 'coreutils/stat.c')
-rw-r--r-- | coreutils/stat.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/coreutils/stat.c b/coreutils/stat.c index 2bc9a086c..bbd2e6a7c 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c | |||
@@ -640,29 +640,29 @@ static bool do_stat(const char *filename, const char *format) | |||
640 | } | 640 | } |
641 | 641 | ||
642 | int stat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 642 | int stat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
643 | int stat_main(int argc, char **argv) | 643 | int stat_main(int argc UNUSED_PARAM, char **argv) |
644 | { | 644 | { |
645 | IF_FEATURE_STAT_FORMAT(char *format = NULL;) | 645 | IF_FEATURE_STAT_FORMAT(char *format = NULL;) |
646 | int i; | 646 | int i; |
647 | int ok = 1; | 647 | int ok; |
648 | unsigned opts; | ||
648 | statfunc_ptr statfunc = do_stat; | 649 | statfunc_ptr statfunc = do_stat; |
649 | 650 | ||
650 | getopt32(argv, "ftL" | 651 | opt_complementary = "-1"; /* min one arg */ |
652 | opts = getopt32(argv, "ftL" | ||
651 | IF_SELINUX("Z") | 653 | IF_SELINUX("Z") |
652 | IF_FEATURE_STAT_FORMAT("c:", &format) | 654 | IF_FEATURE_STAT_FORMAT("c:", &format) |
653 | ); | 655 | ); |
654 | 656 | if (opts & OPT_FILESYS) /* -f */ | |
655 | if (option_mask32 & OPT_FILESYS) /* -f */ | ||
656 | statfunc = do_statfs; | 657 | statfunc = do_statfs; |
657 | if (argc == optind) /* files */ | ||
658 | bb_show_usage(); | ||
659 | |||
660 | #if ENABLE_SELINUX | 658 | #if ENABLE_SELINUX |
661 | if (option_mask32 & OPT_SELINUX) { | 659 | if (opts & OPT_SELINUX) { |
662 | selinux_or_die(); | 660 | selinux_or_die(); |
663 | } | 661 | } |
664 | #endif /* ENABLE_SELINUX */ | 662 | #endif |
665 | for (i = optind; i < argc; ++i) | 663 | ok = 1; |
664 | argv += optind; | ||
665 | for (i = 0; argv[i]; ++i) | ||
666 | ok &= statfunc(argv[i] IF_FEATURE_STAT_FORMAT(, format)); | 666 | ok &= statfunc(argv[i] IF_FEATURE_STAT_FORMAT(, format)); |
667 | 667 | ||
668 | return (ok ? EXIT_SUCCESS : EXIT_FAILURE); | 668 | return (ok ? EXIT_SUCCESS : EXIT_FAILURE); |