This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getopt() argument permuting considered risky


Ulrich Drepper <drepper@redhat.com> wrote, on 04 Aug 2004:
>
> I have several programs which depend on the parameter
> ordering and the getopt implementation can very well handle all this.

So what happens if those programs are run with POSIXLY_CORRECT set in
the environment?  Do you explicitly unset it with unsetenv(), so that
the program will still work?

If the standard behaviour was the default, you would achieve the
same effect by setting GNU_GETOPT_PERMUTE (or putting a special
character in the optstring, or whatever).  Seems much neater and
cleaner that way round to me.

> It's just lazy programmers who don't read the documentation which create
> problems.

Huh?  We're talking about programs carefully written to the POSIX
standard.  The problem is caused by running those programs in a
non-standard environment.  There is no programmer laziness involved.

Regards,
Geoff Clare.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]