mlibc icon indicating copy to clipboard operation
mlibc copied to clipboard

getopt_long issues

Open Qwinci opened this issue 1 year ago • 1 comments

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 optind to the starting index of that contiguous sequence of non-options in case it reaches the end of argv.

Qwinci avatar Sep 15 '24 19:09 Qwinci

Partially fixed by #1286.

no92 avatar Mar 17 '25 01:03 no92

Fixed by #1380.

no92 avatar Jul 20 '25 20:07 no92