Kyle Evans 253b638eab getopt_long(3): fix case of malformed long opt
When presented with an arg string like '-l-', getopt_long will successfully
parse out the 'l' short option, then proceed to match '--' against the first
longopts entry as it later does a strncmp with len=0. This latter bit is
arguably another bug in itself, but presumably not a practical issue as all
callers of parse_long_options are already doing the right thing (except this
one pointed out).

An opt string like '-l-' should be considered malformed and throw a bad
argument rather than behaving as if '--' were passed. It cannot possibly do
what the invoker expects, and it's probably the result of a typo (ls -l- a)
rather than any intent.

Reported by:	Tony Overfield <toverfield@yahoo.com>
Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D18616
2019-01-04 03:13:24 +00:00
..
2017-10-31 00:07:04 +00:00
2017-12-27 21:36:37 +00:00
2018-03-29 19:43:29 +00:00
2018-04-27 13:59:24 +00:00
2018-11-04 16:08:59 +00:00
2018-03-21 14:37:04 +00:00
2018-10-12 05:27:58 +00:00
2018-05-18 06:10:16 +00:00
2018-06-27 19:29:15 +00:00
2018-09-19 07:05:31 +00:00
2018-09-20 09:26:10 +00:00
2018-09-19 07:06:20 +00:00
2018-09-20 09:31:27 +00:00
2018-12-31 03:08:01 +00:00
2018-09-22 13:17:30 +00:00
2018-05-23 01:20:31 +00:00
2018-06-17 18:05:27 +00:00
2018-12-29 21:18:01 +00:00
2018-12-31 15:43:06 +00:00
2018-12-29 06:51:10 +00:00