mlibc
mlibc copied to clipboard
getopt_long issues
There are some issues with the current getopt_long implementation, namely:
- It incorrectly treats an argument following a short optional option as a value for that option (eg. in
sed -i '<pattern>'optarg is incorrectly set to<pattern>when parsing-i). - It doesn't move the non-arguments to the end of the argv array like it is supposed to do and set
optindto the starting index of that contiguous sequence of non-options in case it reaches the end ofargv.
Partially fixed by #1286.
Fixed by #1380.