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

@ -382,9 +382,10 @@ static textwindows errno_t posix_spawn_nt_impl(
envp = environ;
if ((fdspec = __describe_fds(fds.p, fds.n, &startinfo, hCreatorProcess,
&lpExplicitHandles, &dwExplicitHandleCount))) {
rc = ntspawn(dirhand, path, argv, envp, (char *[]){fdspec, maskvar, 0},
dwCreationFlags, lpCurrentDirectory, 0, lpExplicitHandles,
dwExplicitHandleCount, &startinfo, &procinfo);
rc = ntspawn(&(struct NtSpawnArgs){
dirhand, path, argv, envp, (char *[]){fdspec, maskvar, 0},
dwCreationFlags, lpCurrentDirectory, 0, lpExplicitHandles,
dwExplicitHandleCount, &startinfo, &procinfo});
}
if (rc == -1) {
err = errno;