Skip to content

Commit

Permalink
* prefer rundll under windows
Browse files Browse the repository at this point in the history
* use double quotes around urls under windows
  • Loading branch information
eserte committed Jan 20, 2008
1 parent 1b29a3f commit e02d52d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions WWWBrowser.pm
@@ -1,7 +1,7 @@
# -*- perl -*-

#
# $Id: WWWBrowser.pm,v 2.41 2008/01/20 19:16:09 eserte Exp $
# $Id: WWWBrowser.pm,v 2.42 2008/01/20 22:03:23 eserte Exp $
# Author: Slaven Rezic
#
# Copyright (C) 1999,2000,2001,2003,2005,2006,2007 Slaven Rezic.
Expand All @@ -23,7 +23,7 @@ use vars qw(@unix_browsers @available_browsers
$VERSION $VERBOSE $initialized $os $fork
$got_from_config $ignore_config);

$VERSION = sprintf("%d.%02d", q$Revision: 2.41 $ =~ /(\d+)\.(\d+)/);
$VERSION = sprintf("%d.%02d", q$Revision: 2.42 $ =~ /(\d+)\.(\d+)/);

@available_browsers = qw(_debian_browser _internal_htmlview
_default_gnome _default_kde
Expand Down Expand Up @@ -185,21 +185,26 @@ sub start_browser_windows {
my($url, %args) = @_;
my @methods;
if ($ENV{OS} && $ENV{OS} eq 'Windows_NT') { # NT, 2000, XP, Vista...
@methods = qw(start win32util explorer);
@methods = qw(rundll start win32util explorer);
} else {
@methods = qw(win32util start explorer);
}

for my $method (@methods) {
if ($method eq 'start') {
if ($method eq 'rundll') {
system("rundll32 url.dll,FileProtocolHandler \"$url\"");
if ($?/256 == 0) {
return 1;
}
} elsif ($method eq 'start') {
# XXX There are reports that "start" and Tk programms
# do not work well together (slow startup and such).
system("start $url");
system("start /b \"$url\"");
if ($?/256 == 0) {
return 1;
}
} elsif ($method eq 'explorer') {
system("start explorer $url");
system("start explorer \"$url\"");
# maybe: system("start", "explorer", $url);
# or: system("start explorer \"$url\"");
if ($?/256 == 0) {
Expand Down

0 comments on commit e02d52d

Please sign in to comment.