From 38b69acb681cc582c7178c1d73a7c630af76aed5 Mon Sep 17 00:00:00 2001 From: brong Date: Tue, 15 Jan 2002 14:04:20 +0000 Subject: [PATCH] use File::Basename if it exists to determine config directory (closes #467107) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2137 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- config/conf.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/conf.pl b/config/conf.pl index 2a6459e6..84c9d6e8 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -8,6 +8,19 @@ ############################################################ $conf_pl_version = "1.2.0"; +############################################################ +# Check what directory we're supposed to be running in, and +# change there if necessary. File::Basename has been in +# Perl since at least 5.003_7, and nobody sane runs anything +# before that, but just in case. +############################################################ + +if (eval q{require "File/Basename.pm"}) { + my $dir = File::Basename::dirname($0); + chdir($dir); +} + + ############################################################ # Some people try to run this as a CGI. That's wrong! ############################################################ -- 2.25.1