Fix issue where squid-analyzer use default configuration file even if a custom one is specified with the -c option. Thanks to Thibaud Aubert for the report.

This commit is contained in:
Darold Gilles 2013-05-29 16:27:56 +02:00
parent 1e609e8b5c
commit 5bc0268ce7
1 changed files with 9 additions and 5 deletions

View File

@ -47,13 +47,17 @@ if ($build_date) {
}
}
# Allow backward compatibility with release < 4.0
$configfile = $ARGV[0] if (($#ARGV == 0) && $ARGV[0]);
if (($#ARGV < 0) && -e $DEFAULT_CONFFILE) {
$configfile = $DEFAULT_CONFFILE;
# Look at configuration file
if (!$configfile) {
# Backward compatibility with release < 4.0 with configuration
# file as single argument.
$configfile = $ARGV[0] if (($#ARGV == 0) && $ARGV[0]);
# Set default configuration file
$configfile ||= $DEFAULT_CONFFILE;
}
if (!$configfile || $help) {
if ($help) {
&usage;
exit;
}