ps: restore aix behavior while keeping an original fix

The commit shown below broke the aix behavior that Dr.
Fink recently reported. However, in the proposed patch
the old behavior, showing garbage when '%cpu' was used
with an invalid formatting option, would appear again.

So this patch, based on Werner's patch, goes the extra
distance to prevent that. Along the way we'll disallow
commas in the aix format str to prevent their display.

Reference(s):
https://www.freelists.org/post/procps/Procpsng-400-released-with-newlib,2
. Mar, 2022 - where aix bug was introduced
commit 81df85a1b5

Prototyped-by: Dr. Werner Fink <werner@suse.de>
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2022-03-30 12:00:00 -05:00
committed by Craig Small
parent 28c50b8564
commit 8cb646bdfc
2 changed files with 7 additions and 5 deletions

View File

@@ -592,7 +592,7 @@ static void finalize_stacks (void)
// now accommodate any results not yet satisfied
f_node = format_list;
while (f_node) {
(*f_node->pr)(NULL, NULL);
if (*f_node->pr) (*f_node->pr)(NULL, NULL);
f_node = f_node->next;
}
s_node = sort_list;