commit - 6d91731552a1be86794a0164b9c8313e0631725d
commit + 5a40216f37fc6b40a0861c685f9903f1a8bbb645
blob - fb98cfc6b2c623668487e8e4529b576406056fab
blob + e4ed9f743cc943c005815bac1cf68e1a0fed8192
--- gmid.c
+++ gmid.c
{
switch (check_path(c, fpath, &c->fd)) {
case FILE_EXECUTABLE:
- /* +2 to skip the ./ */
- if (cgi != NULL && starts_with(fpath+2, cgi))
+ if (cgi != NULL && starts_with(fpath, cgi))
return start_cgi(fpath, "", query, fds, c);
/* fallthrough */
return 0;
case FILE_MISSING:
- if (cgi != NULL && starts_with(fpath+2, cgi))
+ if (cgi != NULL && starts_with(fpath, cgi))
return check_for_cgi(fpath, query, fds, c);
if (!start_reply(fds, c, NOT_FOUND, "not found"))
char addr[INET_ADDRSTRLEN];
char *argv[] = { NULL, NULL, NULL };
- spath++;
-
close(p[0]);
if (dup2(p[1], 1) == -1)
goto childerr;
if (asprintf(&portno, "%d", port) == -1)
goto childerr;
- if (asprintf(&ex, "%s%s", dir, spath+1) == -1)
+ if (asprintf(&ex, "%s/%s", dir, spath) == -1)
goto childerr;
if (asprintf(&requri, "%s%s%s", spath,