[BusyBox 0005144]: `top -d 1` results in "invalid number '-1'"

bugs at busybox.net bugs at busybox.net
Fri Sep 26 04:42:47 UTC 2008


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=5144 
====================================================================== 
Reported By:                vapier
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   5144
Category:                   Documentation
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 fixed
Fixed in Version:           svn
====================================================================== 
Date Submitted:             09-25-2008 01:17 PDT
Last Modified:              09-25-2008 21:42 PDT
====================================================================== 
Summary:                    `top -d 1` results in "invalid number '-1'"
Description: 
after upgrading from busybox-1.11.2 to busybox-1.12.0, passing numbers to
top's delay option fails
====================================================================== 

---------------------------------------------------------------------- 
 vda - 09-25-08 04:21  
---------------------------------------------------------------------- 
This is the result of "top b" support. We declare that all args are
options:

        /* all args are options; -n NUM */
        opt_complementary = "-:n+";

but consequently "-d 1" is interpreted as "-d -1"!

I fixed help text in rev 23490 to explicitly show that spaces are not
allowed:

# ./busybox top --help
BusyBox v1.13.0.svn (2008-09-25 12:49:42 CEST) multi-call binary
Usage: top [-b] [-nCOUNT] [-dSECONDS]
...

Better ideas? (as in: patch for getopt32.c anyone?) 

---------------------------------------------------------------------- 
 vda - 09-25-08 04:42  
---------------------------------------------------------------------- 
Ok, worked around it in rev 23491 by taking abs(opt_d) 

---------------------------------------------------------------------- 
 vapier - 09-25-08 21:42  
---------------------------------------------------------------------- 
i dont think decreeing "no spaces!" makes sense.  busybox implements the
utilities as defined by the POSIX standard.  when no standard exists (like
with top), it emulates the behavior of the program it replaces.  the top
program from procps has never required a space between the option and its
argument. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-25-08 01:17  vapier         New Issue                                    
09-25-08 01:17  vapier         Status                   new => assigned     
09-25-08 01:17  vapier         Assigned To               => BusyBox         
09-25-08 01:18  vapier         version                   => 1.12.x          
09-25-08 04:21  vda            Note Added: 0011964                          
09-25-08 04:42  vda            Note Added: 0011974                          
09-25-08 04:43  vda            Status                   assigned => closed  
09-25-08 04:43  vda            Resolution               open => fixed       
09-25-08 04:43  vda            Fixed in Version          => svn             
09-25-08 21:42  vapier         Note Added: 0012114                          
======================================================================




More information about the busybox-cvs mailing list