[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Problem in client/main.c

From: Greg Hudson <ghudson_at_mit.edu>
Date: 2000-11-24 17:52:14 CET

I just looked at how client/main.c invokes apr_getopt_long, and saw:

          /* Since arguments may be interleaved with options, we
             handle arguments right here in the option parsing loop,
             and manually bump opt->ind so apr_getopt_long() can
             continue.

As I have said before, this approach is fundamentally incorrect. A
bare "--" is supposed to terminate the options list, once and for all
time, and if you dive back into apr_getopt_long after you see an
APR_EOF, you'll violate that constraint.

If we want to allow arguments to be interleaved with options, that
will have to be implemented in apr_getopt_long itself, by permuting
the argv array. (This is how the gnu getopt_long does it when you
don't have POSIXLY_CORRECT set in the environment.)
Received on Sat Oct 21 14:36:15 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.