summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Kadzban <bryan@kadzban.is-a-geek.net>2011-09-04 12:59:56 -0700
committerDan Nicholson <dbn.lists@gmail.com>2012-05-10 09:28:55 -0700
commite512071cae836cfd89eff1ec60ee3cd046a18084 (patch)
tree452a6ed6a1ab374b8f88f04ca8a623b75e9d739a
parent5745e1ba0888bfddd6cbdbcbf5890c9427baf5bd (diff)
popt: Reset long argument handling before iterating to next argumentHEADmaster
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
-rw-r--r--popt/popt.c2
1 files changed, 2 insertions, 0 deletions
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--;