Make templates fallback to "default" if they are incomplete.
authorSteinar H. Gunderson <sesse@debian.org>
Mon, 31 Jul 2006 15:01:26 +0000 (17:01 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Mon, 31 Jul 2006 15:01:26 +0000 (17:01 +0200)
perl/Sesse/pr0n/Templates.pm

index 422748640f3682bf8f2931b78f368deead793e84..8ff1e0353457360b2cc69dd3356610f23a8d4d79 100644 (file)
@@ -58,6 +58,7 @@ sub fetch_template {
 
        my $base = $r->dir_config('TemplateBase');
        open TEMPLATE, "<$base/$dir/$template"
+               or ($dir ne 'default' and open TEMPLATE, "<$base/default/$template")
                or Sesse::pr0n::Common::error($r, "Couldn't open $dir/$template: $!");
 
        local $/;