aboutsummaryrefslogtreecommitdiff
path: root/gg.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-10-15 15:06:34 +0000
committerOmar Polo <op@omarpolo.com>2023-10-15 15:06:34 +0000
commitc7bcd4a8a9b22a4b28136e24069279cb93b1e43d (patch)
treec42aa12a8c82f68a4ef72c2fc933ca2cc9c5f834 /gg.c
parent4db22ea6547cf324376dc9561e01b84e78825e4d (diff)
gg: exit with the gemini response code
0 is still used for 2X replies, and "external" failures (e.g. network, tls, ...) are still using exit code 1. Gemini non-2x replies now get their response code reported as-is as status code.
Diffstat (limited to 'gg.c')
-rw-r--r--gg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gg.c b/gg.c
index 6b3830d..6f2ee68 100644
--- a/gg.c
+++ b/gg.c
@@ -428,6 +428,7 @@ main(int argc, char **argv)
#endif
code = get(*argv);
-
- return code < 20 || code >= 30;
+ if (code >= 20 && code < 30)
+ return 0;
+ return code;
}