From b4a8feff82b1bf917088654752fe06103b35b0da Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jul 2009 20:55:03 -0400 Subject: [PATCH] Convert Opera's file://localhost/ to file:/// --- projects/mozilla/vlcplugin.cpp | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/projects/mozilla/vlcplugin.cpp b/projects/mozilla/vlcplugin.cpp index 3a49e8e..976b71f 100644 --- a/projects/mozilla/vlcplugin.cpp +++ b/projects/mozilla/vlcplugin.cpp @@ -504,6 +504,25 @@ relativeurl: ++pathstart; } } + + /* + ** ignore the localhost part when protocol is file + ** Opera uses localhost which VLC does not support + */ + const char* psz_skipped_protocol = "file://"; + const char* psz_skipped_host = "localhost"; + /* + ** if protocol is file: and there is localhost after it then drop localhost + ** makes URIs like file://localhost/C:/ become file:///C:/ + ** which is what Firefox, Safari use by default and what VLC supports + */ + if( strstr(href, psz_skipped_protocol) == href + && strstr(pathstart, psz_skipped_host) == pathstart ) + { + // get everything after "localhost" and paste at pathstart location + strcpy(pathstart, pathstart+strlen(psz_skipped_host)); + } + /* skip over host part */ pathstart = strchr(pathstart, '/'); if( ! pathstart ) -- 1.6.3.2.1299.gee46c