Skip to content
  • jim warner's avatar
    top: address the argument parsing quirk involving '-h' · c409f5a4
    jim warner authored
    There exists the possibility that a 'putp' call can be
    issued before the 'setupterm' invocation has occurred,
    as is reflected in a bugzilla report referenced below.
    
    Strangely, such a SEGV isn't always triggered as logic
    would suggest it ought to be. I experienced a fault in
    these environments with the associated curses version:
    . archlinux, procps-ng 3.3.12, ncurses 6.0.20170429
    . fedora-25, procps-ng 3.3.10, ncurses 6.0.20160709
    . opensuse-42.2, procps-ng 3.3.9, ncurses 5.9.20140201
    . gentoo, procps-ng 3.3.12, ncurses 6.0.20150808
    . slackw-14.2, procps-ng 3.3.12, ncurses 6.0.20160910
    
    Whereas under these environments there was no problem:
    . ubuntu-17.04, procps-ng 3.3.12, ncurses 6.0.20160625
    . debian-test, procps-ng 3.3.12, ncurses 6.0.20161126
    . mageia-5.1, procps-ng 3.3.9, ncurses 5.9.20140323
    
    [ as an aside, the expected result in the bug report ]
    [ is incorrect and should mention the '1' parameter. ]
    
    [ however, until release 3.3.13 when the '1' becomes ]
    [ a valid switch, numbers are not detected when used ]
    [ with any switch which doesn't require an argument. ]
    
    [ you're welcome to treat that as a separate bugglet ]
    
    Reference(s):
    https://bugzilla.redhat.com/show_bug.cgi?id=1450429
    
    
    
    Signed-off-by: default avatarJim Warner <james.warner@comcast.net>
    c409f5a4