From 6bc03f4b72fa57d1570e4aaa803f3bd1a32123ff Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 19 May 2007 12:38:34 +0000 Subject: [PATCH] Prepend file:// if the URI in wxLaunchDefaultBrowser() has no scheme and the local file exists. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46122 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/utilscmn.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 732b244072..b615472858 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -734,7 +734,12 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags) wxString url(urlOrig); wxURI uri(url); if ( !uri.HasScheme() ) - url.Prepend(wxT("http://")); + { + if (wxFileExists(urlOrig)) + url.Prepend( wxT("file://") ); + else + url.Prepend(wxT("http://")); + } #if defined(__WXMSW__)