mirror of
https://github.com/git/git.git
synced 2026-03-18 04:30:09 +01:00
Report errors when failing to launch the html browser in mingw.
The mingw function to launch the system html browser is silent if the target file does not exist leaving the user confused. Make it display something. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
This commit is contained in:
committed by
Johannes Schindelin
parent
ad3bd3124a
commit
6a9224c191
@@ -1585,6 +1585,7 @@ void mingw_open_html(const char *unixpath)
|
||||
const char *, const char *, const char *, INT);
|
||||
T ShellExecute;
|
||||
HMODULE shell32;
|
||||
int r;
|
||||
|
||||
shell32 = LoadLibrary("shell32.dll");
|
||||
if (!shell32)
|
||||
@@ -1594,9 +1595,12 @@ void mingw_open_html(const char *unixpath)
|
||||
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);
|
||||
/* 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)
|
||||
|
||||
Reference in New Issue
Block a user