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

main.c: Remove unused EXIT_STATUS_EXACT option #2915

Merged
merged 1 commit into from
Sep 28, 2023

Commits on Sep 28, 2023

  1. main.c: Remove unused EXIT_STATUS_EXACT option

    In process there is a suspicious  options |= EXIT_STATUS_EXACT  that
    is run when the jq script is terminated by halt, or halt_error.
    
    That line of code acutally does nothing because options is a local
    argument variable, and is not passed as a pointer. It was probably meant
    to be a   *options |= EXIT_STATUS_EXACT   with the options argument
    passed as a int*.
    
    In any case, we do not want to run the code in main() that was supposed
    to run if EXIT_STATUS_EXACT is set (but didn't since it is never added
    to options); as far as I can tell, we only want to run that code when
    the --exit-status/-e option is passed.
    
    So I removed EXIT_STATUS_EXACT completely, and the useless assignment,
    instead of fixing it since it was not used for anything else.
    
    Useless assignment detected by clang-tidy.
    emanuele6 committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    02a6780 View commit details
    Browse the repository at this point in the history