0525df57964694680ea2a3d0153a9e5d8013b149
larrym
  Fri Jun 22 15:43:35 2012 -0700
always add CGI name to the body class (enables special casing in style files)
diff --git src/lib/htmshell.c src/lib/htmshell.c
index 2bd191f..7af6bc7 100644
--- src/lib/htmshell.c
+++ src/lib/htmshell.c
@@ -430,34 +430,44 @@
     printf("path=%s; ", encoded_path);
 
 if(domain != NULL)
     printf("domain=%s; ", domain);
 
 if(isSecure == TRUE)
     printf("secure");
 
 printf("\n");
 }
 
 void printBodyTag(FILE *f)
 {
 // print starting BODY tag, including any appropriate attributes (class, background and bgcolor). 
 fprintf(f, "<BODY");
-if (htmlFormClass == NULL )
-    fprintf(f, " CLASS=\"cgi\"");
-else
-    fprintf(f, " CLASS=\"cgi %s\"", htmlFormClass);
+struct slName *classes = NULL;
+
+slNameAddHead(&classes, "cgi");
+char *scriptName = cgiScriptName();
+if(isNotEmpty(scriptName))
+    {
+    char buf[FILENAME_LEN];
+    splitPath(scriptName, NULL, buf, NULL);
+    slNameAddHead(&classes, cloneString(buf));
+}
+if (htmlFormClass != NULL )
+    slNameAddHead(&classes, htmlFormClass);
+fprintf(f, " CLASS=\"%s\"", slNameListToString(classes, ' '));
+
 if (htmlBackground != NULL )
     fprintf(f, " BACKGROUND=\"%s\"", htmlBackground);
 if (gotBgColor)
     fprintf(f, " BGCOLOR=\"#%X\"", htmlBgColor);
 fputs(">\n",f);
 }
 
 void _htmStartWithHead(FILE *f, char *head, char *title, boolean printDocType, int dirDepth)
 /* Write out bits of header that both stand-alone .htmls
  * and CGI returned .htmls need, including optional head info */
 {
 if (printDocType)
     {
 //#define TOO_TIMID_FOR_CURRENT_HTML_STANDARDS
 #ifdef TOO_TIMID_FOR_CURRENT_HTML_STANDARDS