f12b5559197f91a5e62965b28e931f1a0ac8fb4d braney Fri Nov 14 13:11:17 2014 -0800 don't fail on missing hg.conf file when asking for conf variables. diff --git src/hg/lib/hgConfig.c src/hg/lib/hgConfig.c index ed15e65..b1dc23d 100644 --- src/hg/lib/hgConfig.c +++ src/hg/lib/hgConfig.c @@ -152,31 +152,33 @@ lf->fileName, lf->lineIx, line); *value++ = '\0'; name = trimSpaces(name); value = trimSpaces(value); hashAdd(cfgOptionsHash, name, cloneString(value)); /* Set environment variables to enable sql tracing and/or profiling */ if (sameString(name, "JKSQL_TRACE") || sameString(name, "JKSQL_PROF")) envUpdate(name, value); } } static void parseConfigFile(char *filename, int depth) /* open and parse a config file */ { checkConfigPerms(filename); -struct lineFile *lf = lineFileOpen(filename, TRUE); +struct lineFile *lf = lineFileMayOpen(filename, TRUE); +if (lf == NULL) + return; char *line; while(lineFileNext(lf, &line, NULL)) { // check for comment or blank line char *p = skipLeadingSpaces(line); if (!((p[0] == '#') || (p[0] == '\0'))) parseConfigLine(lf, depth, line); } lineFileClose(&lf); } static void addConfigIfUndef(char *prefix, char *suffix, char *value) /* if the specified config item doesn't exist, add it */ { char name[256];