Context.pm - file size test (-s) is subset of file exists test (-e), so testing both...
authorJoe Atzberger <joe.atzberger@liblime.com>
Sat, 2 Feb 2008 05:23:55 +0000 (23:23 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Sun, 3 Feb 2008 13:24:56 +0000 (07:24 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Context.pm

index 361b6dc..303b381 100644 (file)
@@ -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";