summaryrefslogtreecommitdiff
path: root/w32/subproc/sub_proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'w32/subproc/sub_proc.c')
-rw-r--r--w32/subproc/sub_proc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c
index 7cacac6..34cc85d 100644
--- a/w32/subproc/sub_proc.c
+++ b/w32/subproc/sub_proc.c
@@ -593,6 +593,7 @@ process_begin(
STARTUPINFO startInfo;
PROCESS_INFORMATION procInfo;
char *envblk=NULL;
+ int envsize_needed = 0;
int pass_null_exec_path = 0;
/*
@@ -734,10 +735,15 @@ process_begin(
}
if (envp) {
- if (arr2envblk(envp, &envblk) ==FALSE) {
+ if (arr2envblk(envp, &envblk, &envsize_needed) == FALSE) {
pproc->last_err = 0;
pproc->lerrno = E_NO_MEM;
free( command_line );
+ if (pproc->last_err == ERROR_INVALID_PARAMETER
+ && envsize_needed > 32*1024) {
+ fprintf (stderr, "CreateProcess failed, probably because environment is too large (%d bytes).\n",
+ envsize_needed);
+ }
return(-1);
}
}