Cosmetic: Prevent warn: Headers already sent
authorshort <>
Sun, 31 Jul 2005 00:06:48 +0000 (00:06 +0000)
committershort <>
Sun, 31 Jul 2005 00:06:48 +0000 (00:06 +0000)
Web.pm

diff --git a/Web.pm b/Web.pm
index 33324e1..6a4d6ab 100644 (file)
--- a/Web.pm
+++ b/Web.pm
@@ -295,12 +295,16 @@ my($msg)=@_;
        $msg="UNKNOWN" if !$msg;
        cluck "FATAL: $msg";
 
        $msg="UNKNOWN" if !$msg;
        cluck "FATAL: $msg";
 
-       $W->{"indexme"}=0;      # For the case no heading was sent yet.
        # Do not send it unconditionally.
        # The intial duplicated '<?xml...' crashes Gecko parser.
        $W->{"heading_done"}=0 if $W->{"header_only"};
        # Do not send it unconditionally.
        # The intial duplicated '<?xml...' crashes Gecko parser.
        $W->{"heading_done"}=0 if $W->{"header_only"};
-       $W->{"header_only"}=0;  # assurance for &heading
-       My::Web->heading();
+       # Do not send it unconditionally.
+       # Prevents warn: Headers already sent
+       if (!$W->{"heading_done"}) {
+               $W->{"indexme"}=0;      # For the case no heading was sent yet.
+               $W->{"header_only"}=0;  # assurance for &heading
+               My::Web->heading();
+               }
        Wprint "\n".vskip("3ex")."<hr /><h1 class=\"error\">FATAL ERROR: $msg!</h1>\n"
                        ."<p>You can report this problem's details to"
                        ." ".a_href("mailto:".$W->{"admin_mail"},"admin of this website").".</p>\n";
        Wprint "\n".vskip("3ex")."<hr /><h1 class=\"error\">FATAL ERROR: $msg!</h1>\n"
                        ."<p>You can report this problem's details to"
                        ." ".a_href("mailto:".$W->{"admin_mail"},"admin of this website").".</p>\n";