BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005144 [BusyBox] Documentation minor always 09-25-08 01:17 09-26-08 18:37
Reporter vapier View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version 1.12.x
Summary 0005144: `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
Additional Information to reproduce:
- download busybox-1.12.0
- run `make allnoconfig`
- run `make menuconfig` and enable only: Process Utilities -> top
- build it
- run `ln -s busybox top`
- run: ./top
  - see that it works
- run: ./top -d 1
  - top: invalid number '-1'
Attached Files

- Relationships

- Notes
(0011964)
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?)
 
(0011974)
vda
09-25-08 04:42

Ok, worked around it in rev 23491 by taking abs(opt_d)
 
(0012114)
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.
 
(0012254)
vda
09-26-08 18:37

Last fix/workaround allows spaces.
 

- 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
09-26-08 18:37 vda Note Added: 0012254


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker