aboutsummaryrefslogtreecommitdiff
path: root/ex.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-18 15:25:49 +0000
committerOmar Polo <op@omarpolo.com>2021-01-18 15:25:49 +0000
commit568a09c220a706cb717f345a4da14e935dca1672 (patch)
treed860e5c54c216b82a02b79c4f1dbdc816926f5d2 /ex.c
parentf87bf597ea711ef795b27d70fd5b992a80e021c8 (diff)
fix requri construction
when we switched from one process to two, I introduced a small optimisation: empty string are not send, so we receive NULL. Constructing requri we need to make sure that relpath is not null.
Diffstat (limited to 'ex.c')
-rw-r--r--ex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ex.c b/ex.c
index 7ae4e93..c1e1ad9 100644
--- a/ex.c
+++ b/ex.c
@@ -208,7 +208,8 @@ launch_cgi(const char *spath, const char *relpath, const char *query,
goto childerr;
if (asprintf(&requri, "%s%s%s", spath,
- (relpath != NULL && *relpath == '\0') ? "" : "/", relpath) == -1)
+ (relpath != NULL && *relpath == '\0') ? "" : "/",
+ (relpath != NULL ? relpath : "")) == -1)
goto childerr;
argv[0] = argv[1] = ex;