7fdfab0ba90789194773f2bbd31bcc6ab161631a
galt
  Tue Aug 5 10:57:28 2014 -0700
Fixes #12559. GenomeSpace support added to hgTables.
diff --git src/hg/lib/web.c src/hg/lib/web.c
index d74b15c..ff2bc4b 100644
--- src/hg/lib/web.c
+++ src/hg/lib/web.c
@@ -22,30 +22,33 @@
 #include "trackHub.h"
 #include "versionInfo.h"
 
 #ifndef GBROWSE
 #include "axtInfo.h"
 #include "wikiLink.h"
 #include "googleAnalytics.h"
 #include "jsHelper.h"
 #endif /* GBROWSE */
 
 
 /* flag that tell if the CGI header has already been outputed */
 boolean webHeadAlreadyOutputed = FALSE;
 /* flag that tell if text CGI header hsa been outputed */
 boolean webInTextMode = FALSE;
+
+struct hash *includedResourceFiles = NULL;
+
 static char *dbCgiName = "db";
 static char *orgCgiName = "org";
 static char *cladeCgiName = "clade";
 static char *extraStyle = NULL;
 
 /* globals: a cart and db for use in error handlers. */
 static struct cart *errCart = NULL;
 static char *errDb = NULL;
 
 void textVaWarn(char *format, va_list args)
 {
 vprintf(format, args);
 puts("\n");
 }
 
@@ -1177,31 +1180,30 @@
     else // Will be image, since these are the only three choices allowed
         dyStringPrintf(wrapped,"<IMG src='../%s' />\n", link);
     freeMem(link);
     link = dyStringCannibalize(&wrapped);
     }
 
 return link;
 }
 
 char *webTimeStampedLinkToResourceOnFirstCall(char *fileName, boolean wrapInHtml)
 // If this is the first call, will return full path of timestamped link to the requested
 //   resource file (js, or css).  Free after use.
 // else returns NULL.  Useful to ensure multiple references to the same resource file are not made
 // NOTE: png, jpg and gif should also be supported but are untested.
 {
-static struct hash *includedResourceFiles = NULL;
 if (!includedResourceFiles)
     includedResourceFiles = newHash(0);
 
 if (hashLookup(includedResourceFiles, fileName))
     return NULL;
 
 char * link = webTimeStampedLinkToResource(fileName,wrapInHtml);
 if (link)
     hashAdd(includedResourceFiles, fileName, NULL);  // Don't hash link, because
 return link;                                         // memory will be freed by caller!!!
 }
 
 boolean webIncludeResourcePrintToFile(FILE * toFile, char *fileName)
 // Converts fileName to web Resource link and prints the html reference
 // This only prints and returns TRUE on first call for this resource.