Hehe, I forgot to attach the patch O:-)
-- Esteban Manchado Velázquez <[EMAIL PROTECTED]> - http://www.foton.es EuropeSwPatentFree - http://EuropeSwPatentFree.hispalinux.es
--- dhelp-orig 2005-07-10 02:31:32.000000000 +0100 +++ dhelp 2005-08-26 00:34:34.376307840 +0100 @@ -63,29 +63,8 @@ $homedir = (getpwent()) [7]; } -# determine browser to use -my $browser; - -if ($ENV{'BROWSER'}) { - # use user-supplied value - $browser = $ENV{'BROWSER'}; -} elsif ($ENV{'DISPLAY'}) { - # X Window System in charge - $browser = &conf_from_flist("$homedir/.dhelp/www-browser-x", - '/etc/dhelp/www-browser-x'); -} else { - # Fallback to console browser - $browser = &conf_from_flist("$homedir/.dhelp/www-browser-console", - '/etc/dhelp/www-browser-console'); -} - -unless ($browser) { - die "$0: No browser defined.\n"; -} - -unless (&available($browser)) { - die "$0: Browser $browser not executable.\n"; -} +# always use sensible-browser +my $browser = "/usr/bin/sensible-browser"; my $httpd_running = ''; @@ -124,7 +103,7 @@ } else { $document="http://localhost/doc/HTML/index.html"; } - print "Starting $browser (using HTTP $httpd_running) ...\n"; + print "Starting browser (using HTTP $httpd_running) ...\n"; } else { if ($searchterm) { my ($basedir) = File::Spec->tmpdir(); @@ -143,61 +122,12 @@ exit 0; } else { $document="/usr/share/doc/HTML/index.html"; - print "Starting $browser (using local filesystem) ...\n"; + print "Starting browser (using local filesystem) ...\n"; } } system ( "$browser $document" ) and die( "${browser}: Failed to open $document: $!\n" ); -# -------------------------------------------- -# FUNCTION: available PROGRAM -# -# Checks if PROGRAM is available for the user. -# -------------------------------------------- - -sub available { - my $program = shift; - - if ($program =~ m%/%) { - # no need to search the path - return -x $program; - } - - for (split(/:/, $ENV{PATH})) { - return 1 if -x "$_/$program"; - } -} - -# ------------------------------------------------------ -# FUNCTION: conf_from_flist FILE [FILE ...] -# -# Takes a list of files. Reads the first string which is -# not in a commented or empty line from the first -# existing file in the list, strips surrounding blanks -# and returns the resulting string. -# ------------------------------------------------------ - -sub conf_from_flist { - my $ret; - - for my $file (@_) { - next unless -f $file; - open (CONF, $file) - || die "Couldn't open configuration file $file: $!\n"; - while (<CONF>) { - next if /^\#/; - last if /\S/; - chomp; - } - close (CONF); - next unless defined $_; - $ret = $_; - $ret =~ s/^\s+//; - $ret =~ s/\s+$//; - return $ret; - } -} - __END__