aa893970733f283ded63b3ea8ed1ddd43117be74
kate
  Thu Jan 9 21:55:11 2020 -0800
Fix problem with multi-view composites using hideEmptySubtracks. refs #23665

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 7a87bc6..5fd3425 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -4608,38 +4608,42 @@
 struct hash *nonEmptySubtracksHash = hashNew(0);
 for (bb = bbList; bb != NULL; bb = bb->next)
     {
     bigBedIntervalToRow(bb, chromName, startBuf, endBuf, row, ArraySize(row));
     // TODO: do this in bed3Sources.c
     char *idList = row[4];
     struct slName *ids = slNameListFromComma(idList);
     struct slName *id = NULL;
     for (id = ids; id != NULL; id = id->next)
         hashStore(nonEmptySubtracksHash, id->name);
     // TODO: free some stuff ?
     }
 
 // read file containing ids of subtracks 
 struct lineFile *lf = udcWrapShortLineFile(subtrackIdFile, NULL, 0); 
-char *words[2];
-while (lineFileChopNext(lf, words, sizeof words))
+char *words[11];
+int ct = 0;
+while ((ct = lineFileChopNext(lf, words, sizeof words)) != 0)
     {
     char *id = words[0];
-    char *name = words[1];
     if (hashLookup(nonEmptySubtracksHash, id))
         {
-        hashStore(nonEmptySubtracksHash, cloneString(name));
+        int i;
+        for (i=1; i<ct; i++)
+            {
+            hashStore(nonEmptySubtracksHash, cloneString(words[i]));
+            }
         }
     }
 lineFileClose(&lf);
 return nonEmptySubtracksHash;
 }
 
 void makeActiveImage(struct track *trackList, char *psOutput)
 /* Make image and image map. */
 {
 struct track *track;
 MgFont *font = tl.font;
 struct hvGfx *hvg;
 struct tempName pngTn;
 char *mapName = "map";
 int fontHeight = mgFontLineHeight(font);