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

 
 

bug #41187: iconv tool: Broken option parsing

Submitted by:  None
Submitted on:  Fri Jan 10 14:54:29 2014  
 
Category: ProgramSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat Oct 1 16:36:18 2016, 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>
Project AdministratorIn charge of this item.
Fri Jan 10 14:54:29 2014, 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Nov 24 00:05:22 2016haibleCategoryNone=>Program
    Sat Oct 1 16:36:17 2016haibleStatusNone=>Fixed
      Assigned toNone=>haible
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup