X-Git-Url: http://git.shiar.net/perl/plp/.git/blobdiff_plain/c867504b422dfa5cb72370fa828de007718a96b1..7a089d571590f9de96bd54840263ce5376404e66:/lib/PLP/Backend/CGI.pm diff --git a/lib/PLP/Backend/CGI.pm b/lib/PLP/Backend/CGI.pm index 10b9b45..e952c5a 100644 --- a/lib/PLP/Backend/CGI.pm +++ b/lib/PLP/Backend/CGI.pm @@ -17,7 +17,7 @@ sub init { # Run backwards through PATH_TRANSLATED to find target filename, # then get file (relative) by stripping PATH_INFO. my ($path, $rel) = (delete $ENV{PATH_TRANSLATED}, delete $ENV{PATH_INFO}); - my $path_info; + my $path_info = ''; while (not -f $path) { if (not $path =~ s/(\/+[^\/]*)$//) { printf STDERR "PLP: Not found: $path$path_info ($ENV{REQUEST_URI})\n"; @@ -27,7 +27,7 @@ sub init { # move last path element onto PATH_INFO $path_info = $1 . $path_info; } - if (defined $path_info) { + if ($path_info ne '') { $rel =~ s/\Q$path_info\E$//; $ENV{PATH_INFO} = $path_info; }