X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Fconfigure.pm;h=bd3591e3ca3c798d5bbabc37fc4b25903897eadf;hb=8deed905c2f5231a212816034d30581aeac8f845;hp=81a655f11c76c25bd49a787065267500ea1c5c75;hpb=1cf76f8aae0d2be86f85c7abfc3b885f2d6a6441;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/configure.pm b/make/configure.pm index 81a655f11..bd3591e3c 100644 --- a/make/configure.pm +++ b/make/configure.pm @@ -1,10 +1,9 @@ # # InspIRCd -- Internet Relay Chat Daemon # -# Copyright (C) 2012-2017 Peter Powell -# Copyright (C) 2008 Robin Burchell -# Copyright (C) 2007-2008 Craig Edwards -# Copyright (C) 2008 Thomas Stagner +# Copyright (C) 2013-2019 Sadie Powell +# Copyright (C) 2012 Robby +# Copyright (C) 2007-2008 Craig Edwards # Copyright (C) 2007 Dennis Friis # # This file is part of InspIRCd. InspIRCd is free software: you can @@ -273,10 +272,12 @@ sub parse_templates($$$) { chomp $line; # Does this line match a variable? - while ($line =~ /(@(\w+?)@)/) { - my ($variable, $name) = ($1, $2); + while ($line =~ /(@(\w+?)(?:\|(\w*))?@)/) { + my ($variable, $name, $default) = ($1, $2, $3); if (defined $settings{$name}) { $line =~ s/\Q$variable\E/$settings{$name}/; + } elsif (defined $default) { + $line =~ s/\Q$variable\E/$default/; } else { print_warning "unknown template variable '$name' in $_!"; last;