summaryrefslogtreecommitdiff
path: root/amiga/fetch_mailto.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-01-16 15:53:00 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-01-16 15:53:00 +0000
commit8dd9aa4e2198bd7b67f261fb8be36e62fd549822 (patch)
treec3ebc04f5ad9df702239878cd0534c00064b989a /amiga/fetch_mailto.c
parenta6533769115f5ef1a2943cad9116e4da6bd36109 (diff)
downloadnetsurf-8dd9aa4e2198bd7b67f261fb8be36e62fd549822.tar.gz
netsurf-8dd9aa4e2198bd7b67f261fb8be36e62fd549822.tar.bz2
Use OS4.1 Update 1 launch-handler when available. Will fall back to OpenURL.library
even if URL: is dismounted while NetSurf is running. Installation adds the lines to configure launch-handler to open URLs in NetSurf. svn path=/trunk/netsurf/; revision=9835
Diffstat (limited to 'amiga/fetch_mailto.c')
-rwxr-xr-xamiga/fetch_mailto.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/amiga/fetch_mailto.c b/amiga/fetch_mailto.c
index 847135772..1411a5a8e 100755
--- a/amiga/fetch_mailto.c
+++ b/amiga/fetch_mailto.c
@@ -22,6 +22,8 @@
#include <string.h>
#include <proto/exec.h>
+#include <proto/dos.h>
+#include <proto/utility.h>
#include <proto/openurl.h>
struct Library *OpenURLBase;
@@ -51,6 +53,20 @@ void gui_launch_url(const char *url)
{
if(!strncmp("mailto:",url,7))
{
- if(IOpenURL) URL_OpenA(url,NULL);
+ APTR procwin = SetProcWindow((APTR)-1L);
+ char *launchurl = NULL;
+ BPTR fptr = 0;
+
+ launchurl = ASPrintf("URL:%s",url);
+
+ if(launchurl && (fptr = Open(launchurl,MODE_OLDFILE)))
+ {
+ Close(fptr);
+ }
+ else if(IOpenURL)
+ URL_OpenA(url,NULL);
+
+ FreeVec(launchurl);
+ SetProcWindow(procwin);
}
}