Introduction
Introduction Statistics Contact Development Disclaimer Help
youtube/feed: check CGI envs sooner - frontends - front-ends for some sites (ex…
Log
Files
Refs
README
LICENSE
---
commit b2bc3d1b44f371ed541504524d2acd0ebd3fa277
parent 6e9b44889cda7e7eafa338dc616286773b1b75ca
Author: Hiltjo Posthuma <[email protected]>
Date: Sun, 2 Jul 2023 13:34:59 +0200
youtube/feed: check CGI envs sooner
This fixes the usage output if the path is invalid when using Gopher CGI.
Diffstat:
M youtube/feed.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/youtube/feed.c b/youtube/feed.c
@@ -1075,6 +1075,14 @@ main(int argc, char *argv[])
if (path) {
cgimode = 1;
+
+ if ((tmp = getenv("SERVER_NAME")))
+ server_name = tmp;
+ if ((tmp = getenv("SERVER_PORT")))
+ server_port = tmp;
+ if ((tmp = getenv("SERVER_PROTOCOL")) && strstr(tmp, "gopher"))
+ godmode = 1;
+
strlcpy(buf, path, sizeof(buf));
path = buf;
@@ -1086,12 +1094,6 @@ main(int argc, char *argv[])
*p = '\0'; /* NULL terminate */
format = p + 1;
}
- if ((tmp = getenv("SERVER_NAME")))
- server_name = tmp;
- if ((tmp = getenv("SERVER_PORT")))
- server_port = tmp;
- if ((tmp = getenv("SERVER_PROTOCOL")) && strstr(tmp, "gopher"))
- godmode = 1;
} else {
if (argc <= 1)
usage();
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.