* for).
*/
const char* defaultshell = (IsWinNT()
- ? "cmd.exe /x/c" : "command.com /c");
+ ? "cmd.exe /x/d/c" : "command.com /c");
const char *usershell = PerlEnv_getenv("PERL5SHELL");
w32_perlshell_items = tokenize(usershell ? usershell : defaultshell,
&w32_perlshell_tokens,
return ours;
}
+/* This function will not return until the timeout has elapsed, or until
+ * one of the handles is ready. */
DllExport DWORD
win32_msgwait(pTHX_ DWORD count, LPHANDLE handles, DWORD timeout, LPDWORD resultp)
{
}
if (result == WAIT_OBJECT_0 + count) {
/* Message has arrived - check it */
- if (win32_async_check(aTHX)) {
- /* was one of ours */
- break;
- }
+ (void)win32_async_check(aTHX);
}
else {
/* Not timeout or message - one of handles is ready */
return;
}
-DllExport FILE*
-win32_tmpfile(void)
+DllExport int
+win32_tmpfd(void)
{
dTHX;
char prefix[MAX_PATH+1];
#endif
DEBUG_p(PerlIO_printf(Perl_debug_log,
"Created tmpfile=%s\n",filename));
- return fdopen(fd, "w+b");
+ return fd;
}
}
}
}
+ return -1;
+}
+
+DllExport FILE*
+win32_tmpfile(void)
+{
+ int fd = win32_tmpfd();
+ if (fd >= 0)
+ return win32_fdopen(fd, "w+b");
return NULL;
}
if (!extra_quotes
&& cmd_shell
- && (stricmp(arg, "/x/c") == 0 || stricmp(arg, "/c") == 0))
+ && curlen >= 2
+ && *arg == '/' /* see if arg is "/c", "/x/c", "/x/d/c" etc. */
+ && stricmp(arg+curlen-2, "/c") == 0)
{
/* is there a next argument? */
if (args[index+1]) {
/* if this is a pseudo-forked child, we just want to spawn
* the new program, and return */
if (w32_pseudo_id) {
- int status = win32_spawnvp(P_WAIT, cmdname, (char *const *)argv);
+ int status = win32_spawnvp(P_WAIT, cmdname, (const char *const *)argv);
if (status != -1) {
my_exit(status);
return 0;
/* NERR_Success *is* 0*/
if (0 == pfnNetWkstaGetInfo(NULL, 100, &pwi)) {
if (pwi->wki100_langroup && *(pwi->wki100_langroup)) {
- WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_langroup,
+ WideCharToMultiByte(CP_ACP, 0, pwi->wki100_langroup,
-1, (LPSTR)dname, dnamelen, NULL, NULL);
}
else {
- WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_computername,
+ WideCharToMultiByte(CP_ACP, 0, pwi->wki100_computername,
-1, (LPSTR)dname, dnamelen, NULL, NULL);
}
pfnNetApiBufferFree(pwi);
} while (len >= SvLEN(shortpath) && sv_grow(shortpath,len+1));
if (len) {
SvCUR_set(shortpath,len);
+ *SvEND(shortpath) = '\0';
ST(0) = shortpath;
XSRETURN(1);
}
items = 2;
}
SvCUR_set(fullpath,len);
+ *SvEND(fullpath) = '\0';
ST(0) = fullpath;
XSRETURN(items);
}
}
void
+Perl_win32_term(void)
+{
+ OP_REFCNT_TERM;
+ MALLOC_TERM;
+}
+
+void
win32_get_child_IO(child_IO_table* ptbl)
{
ptbl->childStdIn = GetStdHandle(STD_INPUT_HANDLE);