From e512071cae836cfd89eff1ec60ee3cd046a18084 Mon Sep 17 00:00:00 2001 From: Bryan Kadzban Date: Sun, 4 Sep 2011 12:59:56 -0700 Subject: popt: Reset long argument handling before iterating to next argument From the LFS mailing list looking into why check-cmd-options fails using the bundled popt: poptGetNextOption, after it invokes the callback for --define-variable=a=b (the operation of which sets the longArg local variable), does not reset longArg to NULL. So on the next time through its loop (after invoking the --define-variable callback, before invoking the --atleast-pkgconfig-version callback), on line 389 of popt.c, sets con->os->nextArg to longArg (the old "a=b" string). What it should do is set nextArg to nextCharArg (the next item on the command line). This happens if longArg is NULL. http://linuxfromscratch.org/pipermail/lfs-dev/2011-September/065065.html Freedesktop #9584 --- popt/popt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/popt/popt.c b/popt/popt.c index 7d0e3bb..40b961f 100644 --- a/popt/popt.c +++ b/popt/popt.c @@ -297,6 +297,8 @@ int poptGetNextOpt(poptContext con) { int singleDash; while (!done) { + longArg = NULL; + while (!con->os->nextCharArg && con->os->next == con->os->argc && con->os > con->optionStack) con->os--; -- cgit v1.2.3