Bugfix: ape --help should exit 0 (#1060)

This commit is contained in:
Jōshin 2024-01-06 15:07:32 -05:00 committed by GitHub
parent 390335eb45
commit d27a47b0e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -876,7 +876,7 @@ __attribute__((__noreturn__)) static void ShowUsage(int os, int fd, int rc) {
"NAME\n"
"\n"
" actually portable executable loader version " APE_VERSION_STR "\n"
" copyright 2023 justine alexandra roberts tunney\n"
" copyrights 2024 justine alexandra roberts tunney\n"
" https://justine.lol/ape.html\n"
"\n"
"USAGE\n"
@ -979,7 +979,8 @@ EXTERN_C __attribute__((__noreturn__)) void ApeLoader(long di, long *sp,
ShowUsage(os, 2, 1);
} else {
if (argv[1][0] == '-') {
rc = !(argv[1][1] == 'h' && !argv[1][2]) || !StrCmp(argv[1] + 1, "-help");
rc = !((argv[1][1] == 'h' && !argv[1][2]) ||
!StrCmp(argv[1] + 1, "-help"));
ShowUsage(os, 1 + rc, rc);
}
prog = (char *)sp[2];