changeset 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 c7e7b159568d
children f2a8f8981c83
files lib/args.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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,