On Sat, Mar 08, 2008 at 12:10:52PM -0500, Jeff Johnson wrote:
> Running test test1 - 9.
> Test "test1 -2 foo" failed with: "arg1: 0 arg2:  rest: foo" != "arg1:  
> 0 arg2: foo"

I can get that failure if the line I added does not replace the prior
assignment (which makes it affect the case where *origOptString == '\0'
as well as the desired case where it is not '\0').

That's the only explanation I can come up with for why the code would
fail.  I have attached a patch that codes up the increment in a slightly
different way, but I don't see how this change is any different on the
code that follows than what was there before.  (Still, I might have
missed something...)

..wayne..
--- popt.c      9 Mar 2008 20:24:45 -0000       1.119
+++ popt.c      9 Mar 2008 22:15:08 -0000
@@ -931,11 +931,11 @@ int poptGetNextOpt(poptContext con)
            shorty = 1;
 
            origOptString++;
-           if (*origOptString != '\0')
+           if (*origOptString != '\0') {
+               if (*origOptString == '=')
+                   origOptString++;
                con->os->nextCharArg = origOptString;
-#ifdef NOTYET  /* XXX causes test 9 failure. */
-               con->os->nextCharArg = origOptString + (*origOptString == '=');
-#endif
+           }
        }
 
        if (opt == NULL) return POPT_ERROR_BADOPT;      /* XXX can't happen */

Reply via email to