src/hg/encode/validateFiles/validateFiles.c 1.14

1.14 2009/04/02 04:27:21 mikep
making code easier to read
Index: src/hg/encode/validateFiles/validateFiles.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/encode/validateFiles/validateFiles.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -b -B -U 4 -r1.13 -r1.14
--- src/hg/encode/validateFiles/validateFiles.c	26 Mar 2009 06:55:39 -0000	1.13
+++ src/hg/encode/validateFiles/validateFiles.c	2 Apr 2009 04:27:21 -0000	1.14
@@ -818,8 +818,9 @@
 char *type;
 void *func;
 struct chromInfo *ci = NULL;
 struct hash *funcs = newHash(0);
+char *chromDb, *chromInfo;
 optionInit(&argc, argv, options);
 ++argv; 
 --argc;
 if (optionExists("version"))
@@ -835,19 +836,19 @@
 printFailLines = optionExists("printFailLines");
 colorSpace     = optionExists("colorSpace") || sameString(type, "csfasta");
 initArrays();
 // Get chromInfo from DB or file
-if (strlen(optionVal("chromDb", "")) > 0)
+if ( (chromDb = optionVal("chromDb", NULL)) != NULL)
     {
-    if (!(ci = createChromInfoList(NULL, optionVal("chromDb", ""))))
-        errAbort("could not load chromInfo from DB %s\n", optionVal("chromDb", ""));
+    if (!(ci = createChromInfoList(NULL, chromDb)))
+        errAbort("could not load chromInfo from DB %s\n", chromDb);
     chrHash = chromHash(ci);
     chromInfoFree(&ci);
     }
-else if (strlen(optionVal("chromInfo", "")) > 0)
+else if ( (chromInfo=optionVal("chromInfo", NULL)) != NULL)
     {
-    if (!(ci = chromInfoLoadAll(optionVal("chromInfo", ""))))
-	errAbort("could not load chromInfo file %s\n", optionVal("chromInfo", ""));
+    if (!(ci = chromInfoLoadAll(chromInfo)))
+	errAbort("could not load chromInfo file %s\n", chromInfo);
     chrHash = chromHash(ci);
     chromInfoFree(&ci);
     }
 verbose(2,"[%s %3d] type=%s\n", __func__, __LINE__, type);