Commit 2f3ddecc authored by Sergey Lyubka's avatar Sergey Lyubka

Properly trim whitespaces from the hashbang CGI interpreter path

parent 531fec34
...@@ -1964,7 +1964,7 @@ static process_id_t start_process(char *interp, const char *cmd, ...@@ -1964,7 +1964,7 @@ static process_id_t start_process(char *interp, const char *cmd,
buf[sizeof(buf) - 1] = '\0'; buf[sizeof(buf) - 1] = '\0';
if (buf[0] == '#' && buf[1] == '!') { if (buf[0] == '#' && buf[1] == '!') {
interp = buf + 2; interp = buf + 2;
for (p = interp + strlen(interp); for (p = interp + strlen(interp) - 1;
isspace(* (uint8_t *) p) && p > interp; p--) *p = '\0'; isspace(* (uint8_t *) p) && p > interp; p--) *p = '\0';
} }
fclose(fp); fclose(fp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment