[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #50974] SEGFAULT with constructed cmdline_opti
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #50974] SEGFAULT with constructed cmdline_options |
Date: |
Tue, 9 May 2017 00:08:18 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 |
Follow-up Comment #5, bug #50974 (project octave):
jwe - I guess I would expect a user program that processes some command line
options to also adjust argc and argv before passing them in to the application
object.
Let's say I write a program that takes its own arguments, followed by a "--",
followed by Octave interpreter options.
I would probably use getopt_long, finish handling arguments at the "--", and
then create an instance of cli_application, passing in argc-idx and
&argv[idx]. This way the value of optind doesn't have to be a precious value
that is preserved between my call to getopt_long and Octave's call to
getopt_long. And Octave should be able assume that it will start processing at
the beginning of the argv that it was given, so I think it should ensure that
optind is exactly 1 in its own getopt_long loop.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?50974>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/