Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#227 mingwex - runtime - get_opt.c

closed-rejected
nobody
2005-06-21
2005-04-23
Julien Lecomte
No

Bug or feature ? Compiling under MinGW an app that uses
getopt_long and long options will result that partial
matches will succeed in being declared as correct.
In other words : "myapp.exe --silent" and "myapp.exe
--sile" both result in being in silent mode (while the
2nd should print an error message)

This patch fixes get_opt.c

Discussion

  • Julien Lecomte
    Julien Lecomte
    2005-04-23

    get_opt.c patch

     
    Attachments
  • Keith Marshall
    Keith Marshall
    2005-06-21

    Logged In: YES
    user_id=823908

    Are you sure of your facts here. AIUI, this patch will
    *break* correct getopt_long behaviour.

    Quoting from the getopt(3) manpage on my GNU/Linux box:

    The getopt_long() function works like getopt() except
    that it also accepts long options, started out by two dashes.
    Long option names may be abbreviated if the abbreviation is
    unique or is an exact match for some defined option. A long
    option may take a parameter, of the form --arg=param or
    --arg param.

    End quote.

    Thus, for a long argument defined as "--silent" it is
    perfectly correct for "--sile" to match, provided that
    abbreviation is not ambiguous. If this patch does as
    advertised, it will break behaviour which is correct, as
    documented.

     
  • Julien Lecomte
    Julien Lecomte
    2005-06-21

    Logged In: YES
    user_id=827175

    Sorry, the patch isn't acceptable. Hopefully there has been appropriate explanation prior to this action. If not or if
    you have further questions then please ask them at mingw-patches@lists.sourceforge.net and be sure to include the
    patch # in the subject for reference.

     
  • Julien Lecomte
    Julien Lecomte
    2005-06-21

    Logged In: YES
    user_id=827175

    Thanks for the doc, removing patch.

     
  • Julien Lecomte
    Julien Lecomte
    2005-06-21

    • status: open --> closed-rejected