git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] Report errors when failing to launch the html browser in mingw.
@ 2010-03-17 15:20 Pat Thoyts
  2010-03-17 17:01 ` Erik Faye-Lund
  0 siblings, 1 reply; 2+ messages in thread
From: Pat Thoyts @ 2010-03-17 15:20 UTC (permalink / raw)
  To: git; +Cc: msysgit

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>
---
 compat/mingw.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index 9c10a4c..d6539ef 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1548,6 +1548,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)
@@ -1557,9 +1558,11 @@ 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);
+	if (r < 33) {
+		die("failed to launch browser for %.*s", MAX_PATH, unixpath);
+	}
 }
 
 int link(const char *oldpath, const char *newpath)
-- 
1.7.0.2.msysgit.0.3.g3c992.dirty

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-17 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-17 15:20 [PATCH 2/2] Report errors when failing to launch the html browser in mingw Pat Thoyts
2010-03-17 17:01 ` Erik Faye-Lund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).