1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-08 08:58:00 +00:00

Don't exit(1) after printing PGP key fingerprints.

That's not a failure outcome. The user asked for some information; we
printed it; nothing went wrong. Mission successful, so exit(0)!

I noticed this because it was sitting right next to some of the
usage() calls modified in the previous commit. Those also had the
misfeature of exiting with failure after successfully printing the
help, possibly due to confusion arising from the way that usage() was
_sometimes_ printed on error as well. But pgp_fingerprints() has no
such excuse. That one's just silly.
This commit is contained in:
Simon Tatham 2024-09-25 16:26:17 +01:00
parent ecfa6b2734
commit 11d1f3776b
8 changed files with 8 additions and 8 deletions

2
pscp.c
View File

@ -2299,7 +2299,7 @@ int psftp_main(CmdlineArgList *arglist)
verbose = true;
} else if (strcmp(argstr, "-pgpfp") == 0) {
pgp_fingerprints();
return 1;
return 0;
} else if (strcmp(argstr, "-r") == 0) {
recursive = true;
} else if (strcmp(argstr, "-p") == 0) {

View File

@ -2839,7 +2839,7 @@ int psftp_main(CmdlineArgList *arglist)
cleanup_exit(0);
} else if (strcmp(argstr, "-pgpfp") == 0) {
pgp_fingerprints();
return 1;
return 0;
} else if (strcmp(argstr, "-V") == 0 ||
strcmp(argstr, "--version") == 0) {
version();

View File

@ -529,7 +529,7 @@ bool do_cmdline(int argc, char **argv, bool do_everything, Conf *conf)
} else if (!strcmp(p, "-pgpfp")) {
pgp_fingerprints();
exit(1);
exit(0);
} else if (has_ca_config_box &&
(!strcmp(p, "-host-ca") || !strcmp(p, "--host-ca") ||

View File

@ -747,7 +747,7 @@ int main(int argc, char **argv)
exit(0);
} else if (!strcmp(p, "-pgpfp")) {
pgp_fingerprints();
exit(1);
exit(0);
} else if (!strcmp(p, "-o")) {
if (argc <= 1) {
fprintf(stderr,

View File

@ -1616,7 +1616,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
clkey->add_encrypted = add_keys_encrypted;
} else if (match_opt("-pgpfp")) {
pgp_fingerprints_msgbox(NULL);
return 1;
return 0;
} else if (match_opt("-restrict-acl", "-restrict_acl",
"-restrictacl")) {
restrict_process_acl();

View File

@ -352,7 +352,7 @@ int main(int argc, char **argv)
exit(0);
} else if (!strcmp(p, "-pgpfp")) {
pgp_fingerprints();
exit(1);
exit(0);
} else if (!strcmp(p, "-shareexists")) {
just_test_share_exists = true;
} else if (!strcmp(p, "-sanitise-stdout") ||

View File

@ -87,7 +87,7 @@ void gui_term_process_cmdline(Conf *conf, char *cmdline)
exit(0);
} else if (!strcmp(p, "-pgpfp")) {
pgp_fingerprints_msgbox(NULL);
exit(1);
exit(0);
} else if (has_ca_config_box &&
(!strcmp(p, "-host-ca") || !strcmp(p, "--host-ca") ||
!strcmp(p, "-host_ca") || !strcmp(p, "--host_ca"))) {

View File

@ -2436,7 +2436,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
}
} else if (match_opt("-pgpfp")) {
pgp_fingerprints_msgbox(NULL);
return 1;
return 0;
} else if (match_opt("-restrict-acl", "-restrict_acl",
"-restrictacl")) {
restrict_process_acl();