6f7bcefb475dc9d24b5740afe9ffdf64d96633b5 max Tue Sep 22 01:45:46 2015 -0700 adding comment after code review, refs #16057 diff --git src/hg/lib/customPp.c src/hg/lib/customPp.c index 5bd44e6..1e42dad 100644 --- src/hg/lib/customPp.c +++ src/hg/lib/customPp.c @@ -93,31 +93,34 @@ cpp->reusedLines = reused->next; cpp->inReuse = reused; return reused->name; } /* Get next line from file on top of stack. If at EOF * go to next file in stack. If get a http:// or https:// or ftp:// line * open file this references and push it onto stack. Meanwhile * squirrel away 'browser' lines. */ struct lineFile *lf; while ((lf = cpp->fileStack) != NULL) { char *line; if (lineFileNext(lf, &line, NULL)) { - if (startsWith("http://", line) || startsWith("https://", line) || startsWith("ftp://", line) || (cfgOption("udc.localDir")!=NULL && startsWith(cfgOption("udc.localDir"), line)) ) + // if user pastes just a URL, create a track line automatically + // also allow a filename from a local directory if it has been allowed via udc.localDir in hg.conf + if (startsWith("http://", line) || startsWith("https://", line) || startsWith("ftp://", line) || + (cfgOption("udc.localDir")!=NULL && startsWith(cfgOption("udc.localDir"), line)) ) { if (customTrackIsBigData(line)) line = bigUrlToTrackLine(line); else { lf = netLineFileOpen(line); slAddHead(&cpp->fileStack, lf); #ifdef PROGRESS_METER off_t remoteSize = 0; remoteSize = remoteFileSize(line); cpp->remoteFileSize = remoteSize; #endif continue; } }