mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-15 02:08:08 +08:00
spawn_process(): reading hashbang string correctly on Windows
This commit is contained in:
parent
5303e37702
commit
71b6a53617
@ -1172,6 +1172,7 @@ static pid_t spawn_process(struct mg_connection *conn, const char *prog,
|
||||
interp = conn->ctx->config[CGI_INTERPRETER];
|
||||
if (interp == NULL) {
|
||||
buf[2] = '\0';
|
||||
mg_snprintf(conn, cmdline, sizeof(cmdline), "%s%c%s", dir, DIRSEP, prog);
|
||||
if ((fp = fopen(cmdline, "r")) != NULL) {
|
||||
(void) fgets(buf, sizeof(buf), fp);
|
||||
if (buf[0] != '#' || buf[1] != '!') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user