1203d7c21e26bd5d57154cc5c0c42780b8b5ca1a chmalee Tue Oct 27 10:11:47 2020 -0700 Fixing bug in mouseOver trackDb setting, if a field to be substituted is a prefix to another field to be substituted, allow user to wrap one/both fields in curly braces like shell in order to protect the substitution diff --git src/hg/lib/hui.c src/hg/lib/hui.c index 0794478..3dc1c91 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -9401,39 +9401,56 @@ return list; } static struct dyString *subMultiField(char *pattern, int fieldCount, char *in[], char *out[]) /* Substitute $in with out values in pattern */ { int i; struct dyString *s = newDyString(256), *d = NULL; dyStringAppend(s, pattern); for (i=0; istring)) + { + d = dyStringSub(s->string, strictSpec, out[i]); + s = d; + } + // the user may have both a ${} enclosed instance and a non-enclosed one! d = dyStringSub(s->string, spec, out[i]); + dyStringFree(&s); freeMem(spec); + freeMem(strictSpec); s = d; d = NULL; } return s; } char *replaceFieldInPattern(char *pattern, int fieldCount, char **fieldNames, char **fieldVals) /* Replace $fieldName in pattern with value. Used in trackDb mouseOver setting */ { struct dyString *ds = subMultiField(pattern, fieldCount, fieldNames, fieldVals); return dyStringCannibalize(&ds); } static struct dyString *subMulti(char *orig, int subCount, char *in[], char *out[])