11c1c560b88d430fd2c6967a86d2e87109806357
max
  Fri Jan 24 09:15:03 2014 -0800
corrections after code review refs #12524. These changes probably don'tneed to reviewed anymore, as Angie has already seen them, I copied them into
the ticket #12524.

diff --git src/hg/lib/search.c src/hg/lib/search.c
index 61b0e5a..9351056 100644
--- src/hg/lib/search.c
+++ src/hg/lib/search.c
@@ -4,46 +4,44 @@
 #include "cheapcgi.h"
 #include "hdb.h"
 #include "hgConfig.h"
 #include "hPrint.h"
 #include "trix.h"
 #include "mdb.h"
 #include "subText.h"
 #include "jsHelper.h"
 
 void getSearchTrixFile(char *database, char *buf, int len)
 // Fill-in the name of the track search trix file
 {
 char *trixPath = cfgOptionDefault("browser.trixPath", "/gbdb/$db/trackDb.ix");
 struct subText *subList = subTextNew("$db", database);
 subTextStatic(subList, trixPath, buf, len);
-// rewrite the /gbdb-prefix
-char *subBuf = hCloneRewriteFileName(buf);
-memcpy(buf, subBuf, min(len, strlen(subBuf))+1);
+char *subBuf = hReplaceGbdb(buf);
+safecpy(buf, len, subBuf);
 freez(&subBuf);
 }
 
 boolean isSearchTracksSupported(char *database, struct cart *cart)
 // Return TRUE if searchTracks is supported for this database and javascript is supported too
 {
 char trixFile[HDB_MAX_PATH_STRING];
 getSearchTrixFile(database, trixFile, sizeof(trixFile));
-// always return true if trix file is remote
-if (udcIsLocal(trixFile))
-    return fileExists(trixFile);
-else
-    return TRUE;
+char *trixPath = hReplaceGbdb(trixFile);
+bool ret = udcExists(trixPath);
+freez(&trixPath);
+return ret;
 }
 
 struct slPair *fileFormatSearchWhiteList()
 // Gets the whitelist of approved file formats that is allowed for search
 {
 char *crudeTypes[] =
     {
     "bam",  //    "bam.bai" is now alway selected with bam,
     "tagAlign",
     "bed.gz",
     "bigBed",
     "broadPeak",
     "narrowPeak",
     "fastq",
     "bigWig",