diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-10-26 10:16:59 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-10-26 10:18:40 +0000 |
commit | b16038cb1ef466c42548534047b02e53b3f87784 (patch) | |
tree | 3df492b3960603901990f3ea583b99c09c34f5bc /amiga/launch.c | |
parent | d732b0c76950bfdeaa9777bfac0c73517c25a9e0 (diff) | |
download | netsurf-b16038cb1ef466c42548534047b02e53b3f87784.tar.gz netsurf-b16038cb1ef466c42548534047b02e53b3f87784.tar.bz2 |
We have all the schemes as interned strings, so compare them instead of strncasecmp.
Diffstat (limited to 'amiga/launch.c')
-rwxr-xr-x | amiga/launch.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/amiga/launch.c b/amiga/launch.c index c14e2a727..67d74e49d 100755 --- a/amiga/launch.c +++ b/amiga/launch.c @@ -86,23 +86,31 @@ void ami_openurl_free_list(struct MinList *list) }while(node=nnode); } -BOOL ami_openurl_check_list(struct MinList *list, const char *url) +BOOL ami_openurl_check_list(struct MinList *list, nsurl *url) { struct ami_protocol *node; struct ami_protocol *nnode; + lwc_string *url_scheme; + bool match; if(IsMinListEmpty(list)) return FALSE; + + url_scheme = nsurl_get_component(ns_url, NSURL_SCHEME); + node = (struct ami_protocol *)GetHead((struct List *)list); do { nnode=(struct ami_protocol *)GetSucc((struct Node *)node); - if (!strncasecmp(url, lwc_string_data(node->protocol), - lwc_string_length(node->protocol))) + if (lwc_string_isequal(url_scheme, node->protocol, + &match) == NSERROR_OK && match == true) { + lwc_string_unref(url_scheme); return TRUE; + } }while(node=nnode); + lwc_string_unref(url_scheme); return FALSE; } @@ -136,7 +144,7 @@ nserror gui_launch_url(struct nsurl *url) APTR procwin = SetProcWindow((APTR)-1L); char *launchurl = NULL; - if(ami_openurl_check_list(&ami_unsupportedprotocols, nsurl_access(url)) == FALSE) + if(ami_openurl_check_list(&ami_unsupportedprotocols, url) == FALSE) { if(IOpenURL) { |