From 2830b4a411593860aa75ae22478d09db14c789cf Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 10 May 2005 23:38:12 +0000 Subject: [PATCH] Have wxLaunchDefaultBrowser fallback to the BROWSER environment variable on *nix if the mimetype info fails to lead to a usable command. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34013 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/utilscmn.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 977675ac1a..2468ed2c00 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -660,7 +660,13 @@ bool wxLaunchDefaultBrowser(const wxString& url) } } else - return false; + { + // fallback to checking for the BROWSER environment variable + cmd = wxGetenv(wxT("BROWSER")); + if ( cmd.empty() || wxExecute(cmd + wxT(" ") + finalurl) == -1) + return false; + } + #else // !wxUSE_MIMETYPE && !(WXMSW && wxUSE_NATIVE_CONFIG) -- 2.45.2