0acf4355df2f200c8e0cf4958f5007a9a3f1455b
angie
  Fri Mar 14 15:13:29 2014 -0700
Tweaking bigUrlToTrackLine to handle ".vcf.gz" which has two file extensions.
diff --git src/hg/lib/customPp.c src/hg/lib/customPp.c
index cd37356..f98aa20 100644
--- src/hg/lib/customPp.c
+++ src/hg/lib/customPp.c
@@ -42,43 +42,44 @@
 if (cpp)
     {
     lineFileCloseList(&cpp->fileStack);
     slFreeList(&cpp->browserLines);
     slFreeList(&cpp->reusedLines);
     freeMem(cpp->inReuse);
     slFreeList(&cpp->skippedLines);
     }
 }
 
 static char* bigUrlToTrackLine(char *url)
 /* given the URL to a big file, create a custom track
  * line for it, has to be freed. Return NULL
  * if it's not a big file URL  */
 {
+char *type = customTrackTypeFromBigFile(url);
+if (type==NULL)
+    return url;
+
 struct netParsedUrl npu;
 netParseUrl(url, &npu);
-
 char baseName[PATH_LEN];
-char ext[FILEEXT_LEN];
-splitPath(npu.file, NULL, baseName, ext);
+splitPath(npu.file, NULL, baseName, NULL);
+// For vcfTabix files that end in ".vcf.gz", only the ".gz" is stripped off by splitPath;
+// strip off the remaining ".vcf":
+if (endsWith(baseName, ".vcf"))
+    baseName[strlen(baseName)-4] = '\0';
 char *trackName = baseName;
 
-eraseTrailingSpaces(ext);
-char *type = customTrackTypeFromBigFile(ext);
-if (type==NULL)
-    return url;
-
 char buf[4000];
 safef(buf, sizeof(buf), "track name=%s bigDataUrl=%s type=%s\n", trackName, url, type);
 
 freeMem(type);
 return cloneString(buf);
 }
 
 char *customPpNext(struct customPp *cpp)
 /* Return next line. */
 {
 /* Check first for line to reuse. */
 struct slName *reused = cpp->reusedLines;
 if (reused)
     {
     /* We need to keep line actually reusing in memory until next