summaryrefslogtreecommitdiff
path: root/coreutils/stat.c
diff options
context:
space:
mode:
authorDenys Vlasenko2009-11-28 15:18:53 +0100
committerDenys Vlasenko2009-11-28 15:18:53 +0100
commite992bae6f9adf3718c6263a36c004ead1c7272a8 (patch)
treef0bc9e4fa145f58ab3f9838902e09f9cfba29648 /coreutils/stat.c
parent86cfb70ca5f2bde11f2d071bc59db75291d8552f (diff)
downloadbusybox-e992bae6f9adf3718c6263a36c004ead1c7272a8.zip
busybox-e992bae6f9adf3718c6263a36c004ead1c7272a8.tar.gz
*: remove a few more cases of argc usage. -89 bytes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/stat.c')
-rw-r--r--coreutils/stat.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/coreutils/stat.c b/coreutils/stat.c
index 2bc9a08..bbd2e6a 100644
--- a/coreutils/stat.c
+++ b/coreutils/stat.c
@@ -640,29 +640,29 @@ static bool do_stat(const char *filename, const char *format)
}
int stat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int stat_main(int argc, char **argv)
+int stat_main(int argc UNUSED_PARAM, char **argv)
{
IF_FEATURE_STAT_FORMAT(char *format = NULL;)
int i;
- int ok = 1;
+ int ok;
+ unsigned opts;
statfunc_ptr statfunc = do_stat;
- getopt32(argv, "ftL"
+ opt_complementary = "-1"; /* min one arg */
+ opts = getopt32(argv, "ftL"
IF_SELINUX("Z")
IF_FEATURE_STAT_FORMAT("c:", &format)
);
-
- if (option_mask32 & OPT_FILESYS) /* -f */
+ if (opts & OPT_FILESYS) /* -f */
statfunc = do_statfs;
- if (argc == optind) /* files */
- bb_show_usage();
-
#if ENABLE_SELINUX
- if (option_mask32 & OPT_SELINUX) {
+ if (opts & OPT_SELINUX) {
selinux_or_die();
}
-#endif /* ENABLE_SELINUX */
- for (i = optind; i < argc; ++i)
+#endif
+ ok = 1;
+ argv += optind;
+ for (i = 0; argv[i]; ++i)
ok &= statfunc(argv[i] IF_FEATURE_STAT_FORMAT(, format));
return (ok ? EXIT_SUCCESS : EXIT_FAILURE);