ae63ce55185746c5fabb2ead8cc20215faada36d
max
  Mon Nov 3 08:03:14 2025 -0800
adding ancient dna track, refs #36592

diff --git src/hg/lib/hgConfig.c src/hg/lib/hgConfig.c
index 335f39dd5d5..5cf96c65a68 100644
--- src/hg/lib/hgConfig.c
+++ src/hg/lib/hgConfig.c
@@ -1,27 +1,28 @@
 /* Copyright (C) 2014 The Regents of the University of California 
  * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
 
 #include <stdio.h>
 
 
 #include "common.h"
 #include "hgConfig.h"
 #include "hash.h"
 #include "cheapcgi.h"
 #include "portable.h"
 #include "linefile.h"
+#include "htmshell.h"
 #include "customTrack.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 
 /* the file to read the global configuration info from */
 #define GLOBAL_CONFIG_PATH "."
 #define GLOBAL_CONFIG_FILE "hg.conf"
 //#define GLOBAL_CONFIG_FILE "/usr/local/apache/cgi-bin/hg.conf"
 /* the file to read the user configuration info from, starting at the user's home */
 #define USER_CONFIG_FILE ".hg.conf"
 
 // forwards
 static void parseConfigFile(char *filename, int depth);
 
 /* the hash holding the config options */
@@ -373,15 +374,28 @@
 char *maxMemStr = NULL;
 
 if ((maxMemStr = cfgOption("maxMem")) != NULL)
     {
     unsigned long maxMem = atol(maxMemStr);
     setMemLimit(maxMem);
     }
 }
 
 void cfgSetLogCgiVars()
 /* optionally activate dumping of all CGI variables to stderr log */
 {
 cgiSetMaxLogLen(atoi(cfgOptionDefault("logCgiVarMaxLen", "0")));
 }
 
+void cfgInitCgi()
+/* init kent libraries for CGI programs: max RAM, CGI logging, etc*/
+{
+cfgSetLogCgiVars();
+cfgSetMaxMem();
+
+if (cfgOptionBooleanDefault("showEarlyErrors", FALSE))
+    errAbortSetDoContentType(TRUE);
+
+if (cfgOptionBooleanDefault("suppressVeryEarlyErrors", FALSE))
+    htmlSuppressErrors();
+}
+