Bug 340 - procps-1.2.9 bug fix - sorting in reverse order w/short options
procps-1.2.9 bug fix - sorting in reverse order w/short options
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: procps (Show other bugs)
5.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Michael K. Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1998-12-07 22:23 EST by prince
Modified: 2008-05-01 11:37 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-05-16 17:47:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description prince 1998-12-07 22:23:56 EST
The Problem
===========

Sorting in reverse order with short options didn't work.
Also, sorting in unreversed order didn't work if the
optional '+' was specified.  Example: generate a list of
processes sorted in order by pid.  The following two
commands should generate identical results, but didn't.

ps auxOp
ps auxO+p

The Solution
============

Fix one file, proc/compare.c, as follows, to remove the
offending line. Of course, you can just delete the
offending line rather than comment it out as I've done here.

mystic:/usr/src/redhat/BUILD/procps-1.2.9/proc $ diff -u
compare_old.c compare.c
--- compare_old.c       Mon Dec  7 00:09:23 1998
+++ compare.c   Sun Dec  6 23:44:37 1998
@@ -226,7 +226,15 @@
         if (*opt == '-' || *opt == '+') {
             if (*opt == '-')
                 next_dir = -1;
+            /* [prince] Sun Dec  6 23:38:15 PST 1998
+               The commands "ps -auxOp" and "ps -auxO+p"
should produce
+               identical results, but they don't because
this function
+               incorrectly skips the character after the
'-' or '+' in
+               short option lists.  The '++opt' in the for
() statement will
+               skip past the '-' or '+' anyway.
+               Old Code:
            opt++;
+              End Old Code */
             continue;
         }
         for (i = 0; cmp[i].letter; i++)
Comment 1 Michael K. Johnson 1999-02-11 15:42:59 EST
Will be fixed in procps 1.2.10 or procps 2.0.x, whichever comes first.

Note You need to log in before you can comment on or make changes to this bug.