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