#227 mingwex - runtime - get_opt.c


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


  • Anonymous - 2005-04-23

    get_opt.c patch

  • Keith Marshall

    Keith Marshall - 2005-06-21

    Logged In: YES

    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

  • Anonymous - 2005-06-21

    Logged In: YES

    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.

  • Anonymous - 2005-06-21

    Logged In: YES

    Thanks for the doc, removing patch.

  • Anonymous - 2005-06-21
    • status: open --> closed-rejected

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks