buglibiconv - Bugs: bug #41187, iconv tool: Broken option parsing

 
 

bug #41187: iconv tool: Broken option parsing

Submitter:  None
Submitted:  Fri 10 Jan 2014 02:54:29 PM UTC
   
 
Category:  Program Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 01 Oct 2016 04:36:18 PM UTC, comment #1: 

Thanks for the report. The bug is now fixed, see http://git.savannah.gnu.org/gitweb/?p=libiconv.git;a=commitdiff;h=bd21fb8e3a4437a87925fc3a8545197de21b8849

> I must say this is probably the weirdest and most error-prone option parser I've seen in my life.


Well, such code is straightforward. More declarative approaches exist, but
1. The common form, getopt-gnu, requires yet another (large) module from gnulib.
2. If for every option you have to provide a function, you have to create lots of tiny C functions; if for every option you have to provide a pointer to a variable, the handling of --help and --version is more complex than needed.
You see, it's a trade-off.

Bruno Haible <haible>
Group administrator
Fri 10 Jan 2014 02:54:29 PM UTC, original submission:  

The option parsing in the iconv tool is buggy: The --silent case never increments i and thus loops forever.

Also, I must say this is probably the weirdest and most error-prone option parser I've seen in my life.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-11-24 haible CategoryNone Program
    2016-10-01 haible StatusNone Fixed
        Assigned toNone haible
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code