Mercurial > hg > toybox
comparison 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 |
comparison
equal
deleted
inserted
replaced
890:c7e7b159568d | 891:5735c500f835 |
---|---|
243 lo->len = end-options; | 243 lo->len = end-options; |
244 gof->longopts = lo; | 244 gof->longopts = lo; |
245 options = end; | 245 options = end; |
246 | 246 |
247 // Mark this struct opt as used, even when no short opt. | 247 // Mark this struct opt as used, even when no short opt. |
248 if (!new->c) new->c = -1; | 248 if (!new->c) { |
249 new->c = -1; | |
250 new = 0; | |
251 } | |
249 | 252 |
250 // If this is the start of a new option that wasn't a longopt, | 253 // If this is the start of a new option that wasn't a longopt, |
251 | 254 |
252 } else if (strchr(":*#@.-", *options)) { | 255 } else if (strchr(":*#@.-", *options)) { |
253 if (CFG_TOYBOX_DEBUG && new->type) | 256 if (CFG_TOYBOX_DEBUG && new->type) |