src/hg/hgTables/hgTables.c 1.184

1.184 2009/04/16 18:21:44 angie
Cleaned up another hPrintf vs. fprintf unnecessary duplication and used new constant for 'No results' message.
Index: src/hg/hgTables/hgTables.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/hgTables.c,v
retrieving revision 1.183
retrieving revision 1.184
diff -b -B -U 4 -r1.183 -r1.184
--- src/hg/hgTables/hgTables.c	14 Apr 2009 14:19:53 -0000	1.183
+++ src/hg/hgTables/hgTables.c	16 Apr 2009 18:21:44 -0000	1.184
@@ -161,33 +161,19 @@
 void explainWhyNoResults(FILE *f)
 /* Put up a little explanation to user of why they got nothing. */
 {
 if (f == NULL)
-    {
-    hPrintf("# No results");
-    if (identifierFileName() != NULL)
-        hPrintf(" matching identifier list");
-    if (anyFilter())
-        hPrintf(" passing filter");
-    if (!fullGenomeRegion())
-        hPrintf(" in given region");
-    if (anyIntersection())
-        hPrintf(" after intersection");
-    hPrintf(".");
-    }
-else
-    {
-    fprintf(f, "# No results");
-    if (identifierFileName() != NULL)
+    f = stdout;
+fprintf(f, "# No results");
+if (identifierFileName() != NULL)
         fprintf(f, " matching identifier list");
-    if (anyFilter())
+if (anyFilter())
         fprintf(f, " passing filter");
-    if (!fullGenomeRegion())
+if (!fullGenomeRegion())
         fprintf(f, " in given region");
-    if (anyIntersection())
+if (anyIntersection())
         fprintf(f, " after intersection");
-    fprintf(f, ".");
-    }
+fprintf(f, ".\n");
 }
 
 char *curTableLabel()
 /* Return label for current table - track short label if it's a track */
@@ -1409,9 +1395,9 @@
 	}
     lmCleanup(&lm);
     }
 if (count == 0)
-    hPrintf("\n# No results returned from query.\n\n");
+    hPrintf(NO_RESULTS);
 htmlClose();
 }
 
 void doLookupPosition(struct sqlConnection *conn)