Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getopt_long issues #1125

Open
Qwinci opened this issue Sep 15, 2024 · 0 comments
Open

getopt_long issues #1125

Qwinci opened this issue Sep 15, 2024 · 0 comments

Comments

@Qwinci
Copy link
Contributor

Qwinci commented Sep 15, 2024

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant