mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-24 19:19:00 +08:00
Fixed spawn_proccess() for win32 for .exe binaries
This commit is contained in:
parent
0adef2db5b
commit
30d1573346
@ -1255,7 +1255,7 @@ static pid_t spawn_process(struct mg_connection *conn, const char *prog,
|
||||
// If CGI file is a script, try to read the interpreter line
|
||||
interp = conn->ctx->config[CGI_INTERPRETER];
|
||||
if (interp == NULL) {
|
||||
buf[0] = buf[2] = '\0';
|
||||
buf[0] = buf[1] = '\0';
|
||||
|
||||
// Read the first line of the script into the buffer
|
||||
snprintf(cmdline, sizeof(cmdline), "%s%c%s", dir, '/', prog);
|
||||
@ -1270,6 +1270,8 @@ static pid_t spawn_process(struct mg_connection *conn, const char *prog,
|
||||
for (p = buf + 2; *p != '\0' && isspace(* (unsigned char *) p); )
|
||||
p++;
|
||||
*p = '\0';
|
||||
} else {
|
||||
buf[2] = '\0';
|
||||
}
|
||||
interp = buf + 2;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user