Diff
Not logged in

Differences From:

File src/style.c part of check-in [86ed68ba34] - Add the "Bugs" menu element on the default header. Progress on implementing bug tracking. by drh on 2008-05-17 21:15:24. [view]

To:

File src/style.c part of check-in [dcc48662f8] - Better error messages when trying to run "fossil ui" with an invalid or unaccessible repository. by drh on 2008-06-08 15:45:36. [view]

@@ -42,8 +42,14 @@
 } aSubmenu[30];
 static int nSubmenu = 0;
 
 /*
+** Remember that the header has been generated.  The footer is omitted
+** if an error occurs before the header.
+*/
+static int headerHasBeenGenerated = 0;
+
+/*
 ** Add a new element to the submenu
 */
 void style_submenu_element(
   const char *zLabel,
@@ -99,15 +105,18 @@
   Th_Render(zHeader);
   Th_Unstore("title");   /* Avoid collisions with ticket field names */
   cgi_destination(CGI_BODY);
   g.cgiPanic = 1;
+  headerHasBeenGenerated = 1;
 }
 
 /*
 ** Draw the footer at the bottom of the page.
 */
 void style_footer(void){
   const char *zFooter;
+
+  if( !headerHasBeenGenerated ) return;
 
   /* Go back and put the submenu at the top of the page.  We delay the
   ** creation of the submenu until the end so that we can add elements
   ** to the submenu while generating page text.