$NetBSD: patch-aa,v 1.11 2012/02/13 22:34:38 gls Exp $

Check for configdir.
Fix behavior with perl 5.14: http://sourceforge.net/tracker/index.php?func=detail&aid=3311848&group_id=13764&atid=113764

--- wwwroot/cgi-bin/awstats.pl.orig	2010-10-16 17:24:03.000000000 +0000
+++ wwwroot/cgi-bin/awstats.pl
@@ -1354,7 +1354,7 @@ sub debug {
 sub OptimizeArray {
 	my $array = shift;
 	my @arrayunreg = map {
-		if (/\(\?[-\w]*:(.*)\)/) { $1 }
+		if (/\(\?[-^\w]*:(.*)\)/) { $1 }
 	} @$array;
 	my $notcasesensitive = shift;
 	my $searchlist       = 0;
@@ -1717,7 +1717,7 @@ sub Read_Config {
 			"/etc/opt/awstats"
 		); 
 
-	if ($configdir) {
+	if ($configdir && $ENV{"AWSTATS_ENABLE_CONFIG_DIR"}) {
 		# Check if configdir is outside default values.
 		my $outsidedefaultvalue=1;
 		foreach (@PossibleConfigDir) {
@@ -7809,7 +7809,7 @@ sub DecodeEncodedString {
 # Return:		standardregex
 #------------------------------------------------------------------------------
 sub UnCompileRegex {
-	shift =~ /\(\?[-\w]*:(.*)\)/;
+	shift =~ /\(\?[-^\w]*:(.*)\)/;
 	return $1;
 }
 
