diff --git a/compat/mingw.c b/compat/mingw.c
index ee8f3be5b22df88cdde3667cbbdcff5453e71a08..6590f33cc8157f61ff7b6e0f6330bacf465ad39c 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
mode = va_arg(args, int);
va_end(args);
mode = va_arg(args, int);
va_end(args);
- if (!strcmp(filename, "/dev/null"))
+ if (filename && !strcmp(filename, "/dev/null"))
filename = "nul";
fd = open(filename, oflags, mode);
filename = "nul";
fd = open(filename, oflags, mode);
#undef fopen
FILE *mingw_fopen (const char *filename, const char *otype)
{
#undef fopen
FILE *mingw_fopen (const char *filename, const char *otype)
{
- if (!strcmp(filename, "/dev/null"))
+ if (filename && !strcmp(filename, "/dev/null"))
filename = "nul";
return fopen(filename, otype);
}
filename = "nul";
return fopen(filename, otype);
}
free_path_split(path);
}
free_path_split(path);
}
+void mingw_execv(const char *cmd, char *const *argv)
+{
+ mingw_execve(cmd, argv, environ);
+}
+
static char **copy_environ(void)
{
char **env;
static char **copy_environ(void)
{
char **env;
const char *, const char *, const char *, INT);
T ShellExecute;
HMODULE shell32;
const char *, const char *, const char *, INT);
T ShellExecute;
HMODULE shell32;
+ int r;
shell32 = LoadLibrary("shell32.dll");
if (!shell32)
shell32 = LoadLibrary("shell32.dll");
if (!shell32)
die("cannot run browser");
printf("Launching default browser to display HTML ...\n");
die("cannot run browser");
printf("Launching default browser to display HTML ...\n");
- ShellExecute(NULL, "open", htmlpath, NULL, "\\", 0);
-
+ r = (int)ShellExecute(NULL, "open", htmlpath, NULL, "\\", SW_SHOWNORMAL);
FreeLibrary(shell32);
FreeLibrary(shell32);
+ /* see the MSDN documentation referring to the result codes here */
+ if (r <= 32) {
+ die("failed to launch browser for %.*s", MAX_PATH, unixpath);
+ }
}
int link(const char *oldpath, const char *newpath)
}
int link(const char *oldpath, const char *newpath)