projects
/
matthijs
/
upstream
/
blosxom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid "conditional and" for preparing $path_info
[matthijs/upstream/blosxom.git]
/
blosxom.cgi
diff --git
a/blosxom.cgi
b/blosxom.cgi
index 3b915c5644a33ded46a3ddad5752c535cf0252b3..b80cfbcc1b3e2c3fcb0fc0a8fa9e71df75e63406 100755
(executable)
--- a/
blosxom.cgi
+++ b/
blosxom.cgi
@@
-51,7
+51,8
@@
$show_future_entries = 0;
# (if empty blosxom will load all plugins in $plugin_path directories)
$plugin_list = "";
# (if empty blosxom will load all plugins in $plugin_path directories)
$plugin_list = "";
-# Where are my plugins kept? (list of directories, separated by ':')
+# Where are my plugins kept?
+# List of directories, separated by ';' on windows, ':' everywhere else
$plugin_path = "";
# Where should my plugins keep their state information?
$plugin_path = "";
# Where should my plugins keep their state information?
@@
-136,7
+137,7
@@
$url =~ s!/$!!;
$datadir =~ s!/$!!; $plugin_dir =~ s!/$!!; $static_dir =~ s!/$!!;
# Fix depth to take into account datadir's path
$datadir =~ s!/$!!; $plugin_dir =~ s!/$!!; $static_dir =~ s!/$!!;
# Fix depth to take into account datadir's path
-$depth
and $depth += ($datadir =~ tr[/][]) - 1
;
+$depth
+= ($datadir =~ tr[/][]) - 1 if $depth
;
# Global variable to be used in head/foot.{flavour} templates
$path_info = '';
# Global variable to be used in head/foot.{flavour} templates
$path_info = '';
@@
-156,7
+157,7
@@
$flavour = '';
if ( $path_info[$#path_info] =~ /(.+)\.(.+)$/ ) {
$flavour = $2;
if ( $path_info[$#path_info] =~ /(.+)\.(.+)$/ ) {
$flavour = $2;
- $
1 ne 'index' and $path_info .= "/$1.$2"
;
+ $
path_info .= "/$1.$2" if $1 ne 'index'
;
pop @path_info;
} else {
$flavour = param('flav') || $default_flavour;
pop @path_info;
} else {
$flavour = param('flav') || $default_flavour;
@@
-197,7
+198,8
@@
while (<DATA>) {
}
# Plugins: Start
}
# Plugins: Start
-my @plugin_dirs = split /:/, ($plugin_path || $plugin_dir);
+my $path_sep = $^O eq 'MSWin32' ? ';' : ':';
+my @plugin_dirs = split /$path_sep/, ($plugin_path || $plugin_dir);
my @plugin_list = ();
my %plugin_hash = ();
my @plugin_list = ();
my %plugin_hash = ();
@@
-239,7
+241,7
@@
foreach my $plugin ( @plugin_list ) {
else {
eval { require $plugin };
}
else {
eval { require $plugin };
}
- $@ and warn "error finding or loading blosxom plugin $plugin_name - skipping\n" and next;
+ $@ and warn "
$@
error finding or loading blosxom plugin $plugin_name - skipping\n" and next;
$plugin_name->start() and ( $plugins{$plugin_name} = $on_off ) and push @plugins, $plugin_name;
}
shift @INC foreach @plugin_dirs;
$plugin_name->start() and ( $plugins{$plugin_name} = $on_off ) and push @plugins, $plugin_name;
}
shift @INC foreach @plugin_dirs;