1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-09-01 14:21:56 +03:00

spawn_process(): reading hashbang string correctly on Windows

This commit is contained in:
valenok
2011-06-23 00:07:46 +01:00
parent 5303e37702
commit 71b6a53617

View File

@@ -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] != '!') {