8903bc0ed0ed0a5b499ff4552be2c5c0c8835015 galt Thu Oct 1 16:34:03 2020 -0700 Fixing minor problem with hgBlat Blat-All handling of empty input such as just a blank line, which leads to zero sequences in input. diff --git src/hg/hgBlat/hgBlat.c src/hg/hgBlat/hgBlat.c index 659413e..ff5a784 100644 --- src/hg/hgBlat/hgBlat.c +++ src/hg/hgBlat/hgBlat.c @@ -2047,30 +2047,33 @@ ++dbCount; } dbDbFreeList(&dbList); db = saveDb; organism = saveOrg; hDisconnectCentral(&conn); // Loop over each org's default assembly /* pre-load remote tracks in parallel */ int ptMax = atoi(cfgOptionDefault("parallelFetch.threads", "20")); // default number of threads for parallel fetch. int pfdListCount = 0; pthread_t *threads = NULL; pfdListCount = slCount(pfdList); + if (pfdListCount > 0) + { + /* launch parallel threads */ ptMax = min(ptMax, pfdListCount); if (ptMax > 0) { AllocArray(threads, ptMax); /* Create threads */ int pt; for (pt = 0; pt < ptMax; ++pt) { int rc = pthread_create(&threads[pt], NULL, remoteParallelLoad, &threads[pt]); if (rc) { errAbort("Unexpected error %d from pthread_create(): %s",rc,strerror(rc)); } } @@ -2188,30 +2191,35 @@ "document.mainForm.submit();" "return false;" // cancel the default link url , gH->genome, gH->db ); idCount++; } printf("</TR>\n"); } printf("</TABLE><br><br>\n"); if (debuggingGfResults) printDebugging(); fakeAskForSeqForm(organism, db); + } + else + { + printf("No input sequences provided.<br><br>\n"); + } cartWebEnd(); } else blatSeq(skipLeadingSpaces(userSeq), organism, db, 0); } } /* Null terminated list of CGI Variables we don't want to save * permanently. */ char *excludeVars[] = {"Submit", "submit", "Clear", "Lucky", "type", "userSeq", "seqFile", "showPage", "changeInfo", NULL}; int main(int argc, char *argv[]) /* Process command line. */ {