ea4e0db808801644e3fa40916bc3b0a7216cebba max Wed Jul 5 14:50:26 2017 -0700 fixing a bug in the crisprTrack due to stupid memory management issues. No idea why this code ever worked on the RR. No redmine, email by Hiram diff --git src/hg/hgc/bigBedClick.c src/hg/hgc/bigBedClick.c index 8d016a0..ee32fcf 100644 --- src/hg/hgc/bigBedClick.c +++ src/hg/hgc/bigBedClick.c @@ -192,68 +192,72 @@ /* some extra fields require special printing code, they all start with '_' */ { if (sameWord(name, "_mismatchCounts")) extFieldMismatchCounts(val); else if (sameWord(name, "_crisprOfftargets")) extFieldCrisprOfftargets(val, extraFields); } static void seekAndPrintTable(char *url, off_t offset, struct slPair *extraFields) /* seek to 0 at url, get headers, then seek to offset, read tab-sep fields and output * (extraFields are needed for some special field handlers) */ { char *detailsUrl = replaceChars(url, "$db", database); // open the URL -struct lineFile *lf = lineFileUdcMayOpen(detailsUrl, FALSE); +struct lineFile *lf = lineFileUdcMayOpen(detailsUrl, TRUE); if (lf==NULL) { printf("Error: Could not open the URL referenced in detailsTabUrls, %s", detailsUrl); return; } // get the headers -char *headLine; -int lineSize; +char *headLine = NULL; +int lineSize = 0; lineFileNext(lf, &headLine, &lineSize); char *headers[1024]; int headerCount = chopTabs(headLine, headers); +// clone the headers +int i; +for (i=0; i", detailsUrl); printf("The header line of the tab-sep file has a different number of fields compared "); printf("with the line pointed to by offset %lld in the bigBed file.
", (long long int)offset); printf("Number of headers: %d", headerCount); printf("Number of fields at offset: %d", fieldCount); return; } // print the table for all external extra fields printf("
\n"); fieldCount = min(fieldCount, headerCount); -int i; for (i=0; i\n", name); printf("\n", val); } } printf("
%s%s
\n");