From 7a85fcd4d70de70a15f76fe07856d29a062874bc Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Fri, 1 Feb 2008 23:23:55 -0600 Subject: [PATCH] Context.pm - file size test (-s) is subset of file exists test (-e), so testing both is same as testing -s. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Context.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index 361b6dc0bb..303b38116d 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -263,19 +263,19 @@ sub new { # check that the specified config file exists and is not empty undef $conf_fname unless - (defined $conf_fname && -e $conf_fname && -s $conf_fname); + (defined $conf_fname && -s $conf_fname); # Figure out a good config file to load if none was specified. if (!defined($conf_fname)) { # If the $KOHA_CONF environment variable is set, use # that. Otherwise, use the built-in default. - if (exists $ENV{"KOHA_CONF"} and $ENV{'KOHA_CONF'} and -e $ENV{"KOHA_CONF"} and -s $ENV{"KOHA_CONF"}) { + if (exists $ENV{"KOHA_CONF"} and $ENV{'KOHA_CONF'} and -s $ENV{"KOHA_CONF"}) { $conf_fname = $ENV{"KOHA_CONF"}; - } elsif ($INSTALLED_CONFIG_FNAME !~ /__KOHA_CONF_DIR/ and -e $INSTALLED_CONFIG_FNAME and -s $INSTALLED_CONFIG_FNAME) { + } elsif ($INSTALLED_CONFIG_FNAME !~ /__KOHA_CONF_DIR/ and -s $INSTALLED_CONFIG_FNAME) { # NOTE: be careful -- don't change __KOHA_CONF_DIR in the above # regex to anything else -- don't want installer to rewrite it $conf_fname = $INSTALLED_CONFIG_FNAME; - } elsif (-e CONFIG_FNAME and -s CONFIG_FNAME) { + } elsif (-s CONFIG_FNAME) { $conf_fname = CONFIG_FNAME; } else { warn "unable to locate Koha configuration file koha-conf.xml"; -- 2.39.2