diff lib/args.c @ 891:5735c500f835

Fix bare longopts to set unique optflag bits.
author Rob Landley <rob@landley.net>
date Tue, 30 Apr 2013 00:31:01 -0500
parents 34ac05521d94
children 011df43e35d5
line wrap: on
line diff
--- a/lib/args.c	Mon Apr 29 16:00:40 2013 -0500
+++ b/lib/args.c	Tue Apr 30 00:31:01 2013 -0500
@@ -245,7 +245,10 @@
       options = end;
 
       // Mark this struct opt as used, even when no short opt.
-      if (!new->c) new->c = -1;
+      if (!new->c) {
+        new->c = -1;
+        new = 0;
+      }
 
     // If this is the start of a new option that wasn't a longopt,