76b1ff207748ca1da3d929e5286ccb72bd0528ef
angie
  Wed Jun 12 13:29:36 2013 -0700
Bugfixes and improvements suggested by Brooke in #6152 notes 36, 38, 42.  refs #6152
diff --git src/hg/lib/hgFind.c src/hg/lib/hgFind.c
index 8fc4c01..22112ec 100644
--- src/hg/lib/hgFind.c
+++ src/hg/lib/hgFind.c
@@ -2382,31 +2382,34 @@
 
 static void hgPositionsHtml(char *db, struct hgPositions *hgp, FILE *f,
 		     boolean useWeb, char *hgAppName, struct cart *cart)
 /* Write out hgp table as HTML to file. */
 {
 struct hgPosTable *table;
 struct hgPos *pos;
 char *desc;
 char range[HGPOSRANGESIZE];
 char *ui = getUiUrl(cart);
 char *extraCgi = hgp->extraCgi;
 char hgAppCombiner = (strchr(hgAppName, '?')) ? '&' : '?';
 boolean containerDivPrinted = FALSE;
 
 if (useWeb)
+    {
     webStart(cart, db, "Select Position");
+    db = cartString(cart, "db");
+    }
 
 for (table = hgp->tableList; table != NULL; table = table->next)
     {
     if (table->posList != NULL)
 	{
 	char *parent = hGetParent(db, table->name);
 	char *trackName = table->name;
 	// TODO: should be able to get this from settings hash for
 	// both hub tracks and normal tracks
 	if (!isHubTrack(table->name)) 
 	    trackName = hGetTrackForTable(db, table->name);
         if (trackName == NULL)
             errAbort("no track for table \"%s\" found via a findSpec", table->name); // wish we had searchName
 	char *vis = hCarefulTrackOpenVis(db, trackName);
 	boolean excludeTable = FALSE;