+ /* We need programs like
+ inplace/mingw/libexec/gcc/mingw32/4.5.0/cc1.exe
+ to be able to find the DLLs in inplace/mingw/bin, so we need to
+ add it to $PATH */
+ oldPath = getenv("PATH");
+ if (!oldPath) {
+ die("Couldn't read PATH\n");
+ }
+ n = snprintf(NULL, 0, "PATH=%s;%s", binDir, oldPath);
+ n++;
+ newPath = malloc(n);
+ if (!newPath) {
+ die("Couldn't allocate space for PATH\n");
+ }
+ snprintf(newPath, n, "PATH=%s;%s", binDir, oldPath);
+ n = putenv(newPath);
+ if (n) {
+ die("putenv failed\n");
+ }
+