[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] possible fix for bug with -I/--ignorercfiles

From: Carl @
Subject: Re: [Nano-devel] possible fix for bug with -I/--ignorercfiles
Date: Mon, 22 Jul 2002 23:56:31 +0100

Hee, introducing bugs, sorry about that :)

FYI, this is the relevant paragraph from getopt(3) :

"In order to use getopt() to evaluate multiple sets of arguments, or to
evaluate a single set of arguments multiple times, the variable optreset
must be set to 1 before the second and each additional set of calls to
getopt(), and the variable optind must be reinitialized."

But it seems like you fixed it anyway, so that's all good!

Re: the search history patch I started a while ago, I've not been able to work on it since (It's been one of those months!), but it looks like I'm free to work on it over the next couple of days - I'll send it to be looked over by you guys when it's ready.


On Monday, July 22, 2002, at 10:11 , David Lawrence Ramsey wrote:

After some bizarre problems encountered today with nano
compiled with --enable-nanorc (e. g. 'nano -r 72 -Q
"anything"' results in the usage screen), I've figured out
that the routine to reset getopt[_long]() after checking for
-I/--ignorercfiles isn't properly resetting it.  (Carl
Drinkwater's original version set a variable optreset to 1,
presumably to handle this, but I can't find a reference to
it in the getopt(3) manual, and gcc complains about its not
existing.)  It apparently causes option arguments to be
lost, leading to invalid command lines.  As a workaround for
this, I've replaced the routine with a for loop searching
through argv[] for "--", "-I", and/or "--ignorercfiles" and
handling them; it's a bit uglier, but it appears to handle
them properly, and with it, the above command line works
again.  Or does anyone have a better way?  The patch (which
also changes some spaces to tabs properly in nano.h) is

Sluggy.Net: The Sluggy Freelance Community!

Promote your group and strengthen ties to your members with address@hidden by

----- - Football Management For The Masses
Sign up for free at and compete against
managers from all over the world!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]