musl/src
Rich Felker 9be4ed5d89 getopt_long_only: don't prefix-match long-options that match short ones
for getopt_long, partial (prefix) matches of long options always begin
with "--" and thus can never be ambiguous with a short option. for
getopt_long_only, though, a single-character option can match both a
short option and as a prefix for a long option. in this case, we
wrongly interpreted it as a prefix for the long option.

introduce a new pass, only in long-only mode, to check the prefix
match against short options before accepting it. the only reason
there's a slightly nontrivial loop being introduced rather than strchr
is that our getopt already supports multibyte short options, and
getopt_long_long should handle them consistently. a temp buffer and
strstr could have been used, but the code to set it up would be just
as large as what's introduced here and it would unnecessarily pull in
relatively large code for strstr.
2018-04-27 11:22:39 -04:00
..
aio make all objects used with atomic operations volatile 2015-03-03 22:50:02 -05:00
complex fix incorrect results for catan with some inputs 2018-04-11 15:05:22 -04:00
conf fix sysconf for infinite rlimits 2017-12-14 21:25:10 -05:00
crypt in crypt-sha*, reject excessive rounds as error rather than clamping 2016-02-16 17:38:07 -05:00
ctype update case mappings to unicode 10.0 2017-12-18 19:34:21 -05:00
dirent revise the definition of multiple basic locks in the code 2018-01-09 13:15:27 -05:00
env prevent bypass of guarantee that suids start with fd 0/1/2 open 2018-04-05 11:04:21 -04:00
errno add public interface headers to implementation files 2018-02-25 21:17:48 -05:00
exit revise the definition of multiple basic locks in the code 2018-01-09 13:15:27 -05:00
fcntl fix posix_fadvise syscall args on powerpc, unify with arm fix 2016-07-01 13:32:35 -04:00
fenv add s390x port 2016-11-11 23:06:21 -05:00
internal reintroduce hardening against partially-replaced allocator 2018-04-19 22:22:11 -04:00
ipc fix signed overflow in ftok 2017-08-12 09:09:27 -04:00
ldso fix dl_iterate_phdr in static PIE binaries 2017-04-11 22:10:52 -04:00
legacy fix one-byte overflow in legacy getpass function 2017-03-14 15:13:16 -04:00
linux add getrandom syscall wrapper 2018-02-22 19:34:58 -05:00
locale fix nl_langinfo_l(CODESET, loc) reporting wrong locale's value 2018-03-07 11:22:38 -05:00
malloc reintroduce hardening against partially-replaced allocator 2018-04-19 22:22:11 -04:00
math fix fmaf wrong result 2018-04-02 18:57:41 -04:00
misc getopt_long_only: don't prefix-match long-options that match short ones 2018-04-27 11:22:39 -04:00
mman work around incorrect EPERM from mmap syscall 2017-09-06 22:15:14 -04:00
mq use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
multibyte fix erroneous acceptance of f4 9x xx xx code sequences by utf-8 decoder 2017-09-01 17:05:40 -04:00
network fix getaddrinfo error code for non-numeric service with AI_NUMERICSERV 2017-11-09 20:15:02 -05:00
passwd fix regression in getspnam[_r] error code for insufficient buffer size 2017-06-21 19:06:45 -04:00
prng revise the definition of multiple basic locks in the code 2018-01-09 13:15:27 -05:00
process convert execvp error handling to switch statement 2018-02-21 12:01:29 -05:00
regex fix regression in glob with literal . or .. path component 2017-10-21 12:32:16 -04:00
sched add sched_getcpu vDSO support 2016-03-02 21:35:40 -05:00
search fix lsearch and lfind to pass key as first arg to the compar callback 2017-03-05 20:02:31 -05:00
select support linux kernel apis (new archs) with old syscalls removed 2014-05-29 21:01:32 -04:00
setjmp fix access by setjmp and longjmp to __hwcap on arm built as thumb2 2017-10-13 10:28:52 -04:00
signal add public interface headers to implementation files 2018-02-25 21:17:48 -05:00
stat fix failure of fchmodat to report EOPNOTSUPP in the race path 2015-02-05 23:34:27 -05:00
stdio setvbuf: minor comment typo fix 2018-04-19 12:54:58 -04:00
stdlib add public interface headers to implementation files 2018-02-25 21:17:48 -05:00
string fix OOB reads in Xbyte_memmem 2017-09-04 16:38:03 -04:00
temp ignore access mode bits of flags in mkostemps and functions that use it 2014-10-06 23:13:01 -04:00
termios define appropriate feature test macros to get CBAUD from termios.h 2016-07-03 15:02:23 -04:00
thread store pthread stack guard sizes for pthread_getattr_np 2018-02-03 10:04:24 -05:00
time implement wcsftime padding specifier extensions 2018-04-07 19:03:15 -04:00
unistd fix out of bounds write for zero length buffer in gethostname 2018-04-19 11:45:22 -04:00