e13ac2383aa17a7f37bbea1526a8617af7b0f75d
angie
  Tue May 19 09:58:20 2020 -0700
Bugfix: itemLabel argument to printCustomUrlWithFields and printCustomUrlWithLabel was ignored. tangentially refs #25595
When a different itemLabel and itemName were passed into printCustomUrlWithFields,
itemLabel was ignored for two reasons:
1. In printCustomUrlWithFields, itemName was passed into printCustomUrlWithLabel
as both itemName and itemLabel arguments.
2. In printCustomUrlWithLabel, itemLabel was used only if it was the same as itemName,
which kind of defeats the purpose of itemLabel.

diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index f2fd000..8318bac 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -958,44 +958,44 @@
     printf("<A TARGET=_blank HREF='%s'>%s</A><BR>",eUrl, linkLabel);
     return;
     }
 
 printf("<B>%s </B>",linkLabel);
 
 printf("<A HREF=\"%s\" target=_blank>", eUrl);
 
 if (sameWord(tdb->table, "npredGene"))
     {
     printf("%s (%s)</A><BR>\n", itemName, "NCBI MapView");
     }
 else
     {
     char *label = itemName;
-    if (isNotEmpty(itemLabel) && sameString(itemName, itemLabel))
+    if (isNotEmpty(itemLabel) && differentString(itemName, itemLabel))
         label = itemLabel;
     printf("%s</A><BR>\n", label);
     }
 //freeMem(&eUrl); small memory leak
 }
 
 void printCustomUrlWithFields(struct trackDb *tdb, char *itemName, char *itemLabel, boolean encode,                                                      struct slPair *fields) 
 /* Wrapper to call printCustomUrlWithLabel with additional fields to substitute */
 {
 char urlSetting[10];
 safef(urlSetting, sizeof(urlSetting), "url");
 
-printCustomUrlWithLabel(tdb, itemName, itemName, urlSetting, encode, fields);
+printCustomUrlWithLabel(tdb, itemName, itemLabel, urlSetting, encode, fields);
 }
 
 void printCustomUrl(struct trackDb *tdb, char *itemName, boolean encode)
 /* Wrapper to call printCustomUrlWithLabel using the url setting in trackDb */
 {
 printCustomUrlWithFields(tdb, itemName, itemName, encode, NULL);
 }
 
 void printOtherCustomUrlWithFields(struct trackDb *tdb, char *itemName, char *urlSetting, 
                                         boolean encode, struct slPair *fields)
 /* Wrapper to call printCustomUrlWithLabel to use another url setting other than url in trackDb e.g. url2, this allows the use of multiple urls for a track
  to be set in trackDb. */
 {
 printCustomUrlWithLabel(tdb, itemName, itemName, urlSetting, encode, fields);
 }