summaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/ps.c5
-rw-r--r--procps/top.c5
2 files changed, 5 insertions, 5 deletions
diff --git a/procps/ps.c b/procps/ps.c
index eb1946d..081479b 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -715,7 +715,8 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
# if ENABLE_FEATURE_PS_WIDE
/* -w is a bit complicated */
int w_count = 0;
- opt_complementary = "-:ww";
+ make_all_argv_opts(argv);
+ opt_complementary = "ww";
opts = getopt32(argv, IF_SELINUX("Z")IF_FEATURE_SHOW_THREADS("T")IF_FEATURE_PS_LONG("l")
"w", &w_count);
/* if w is given once, GNU ps sets the width to 132,
@@ -731,7 +732,7 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
}
# else
/* -w is not supported, only -Z and/or -T */
- opt_complementary = "-";
+ make_all_argv_opts(argv);
opts = getopt32(argv, IF_SELINUX("Z")IF_FEATURE_SHOW_THREADS("T")IF_FEATURE_PS_LONG("l"));
# endif
diff --git a/procps/top.c b/procps/top.c
index 015d1ab..1bc432f 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -1110,15 +1110,14 @@ int top_main(int argc UNUSED_PARAM, char **argv)
#endif
/* all args are options; -n NUM */
- opt_complementary = "-"; /* options can be specified w/o dash */
+ make_all_argv_opts(argv); /* options can be specified w/o dash */
col = getopt32(argv, "d:n:b"IF_FEATURE_TOPMEM("m"), &str_interval, &str_iterations);
#if ENABLE_FEATURE_TOPMEM
if (col & OPT_m) /* -m (busybox specific) */
scan_mask = TOPMEM_MASK;
#endif
if (col & OPT_d) {
- /* work around for "-d 1" -> "-d -1" done by getopt32
- * (opt_complementary == "-" does this) */
+ /* work around for "-d 1" -> "-d -1" done by make_all_argv_opts() */
if (str_interval[0] == '-')
str_interval++;
/* Need to limit it to not overflow poll timeout */