Support shebang on Windows

Fixes #1010
This commit is contained in:
Justine Tunney 2024-05-20 22:11:42 -07:00
parent a52792c59f
commit cf70a44756
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 240 additions and 132 deletions

View file

@ -91,9 +91,9 @@ textwindows int sys_execve_nt(const char *program, char *const argv[],
// launch the process
struct NtProcessInformation pi;
int rc = ntspawn(AT_FDCWD, program, argv, envp,
(char *[]){fdspec, maskvar, 0}, 0, 0, hParentProcess,
lpExplicitHandles, dwExplicitHandleCount, &si, &pi);
int rc = ntspawn(&(struct NtSpawnArgs){
AT_FDCWD, program, argv, envp, (char *[]){fdspec, maskvar, 0}, 0, 0,
hParentProcess, lpExplicitHandles, dwExplicitHandleCount, &si, &pi});
__undescribe_fds(hParentProcess, lpExplicitHandles, dwExplicitHandleCount);
if (rc == -1) {
free(fdspec);