From ac76e4db2cbb039bcd37481ba95537b5987a4ab4 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 20 Jun 2017 20:20:20 -0500 Subject: [PATCH] top: fixing command line parsing errors is now a habit Ok, I admit it. I'm now tired of cleaning up after me. This is the 3rd related tweak after that '-1' argument was originally introduced. And with this patch we will once again properly honor the '-o' and '-u|U' switches without a need to be followed by an additional switch. [ one can follow my unfortunate trail of alterations ] [ beginning with my most recent fix referenced below ] Reference(s): commit 4b44aebd807bd132c14df20eabff2f2e9628ef97 Signed-off-by: Jim Warner --- top/top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/top/top.c b/top/top.c index 8c3bd05a..4e81e669 100644 --- a/top/top.c +++ b/top/top.c @@ -3754,7 +3754,7 @@ static void parse_args (char **args) { // advance cp and jump over any numerical args used above if (*cp) cp += strspn(&cp[1], numbs_str); bump_cp: - ++cp; + if (*cp) ++cp; } // end: while (*cp) } // end: while (*args)