aca9143822a9c12b16b33d479a5abb6495b6b4f0
braney
  Wed Aug 19 06:59:39 2026 -0700
lib, hgc, hgTables, hgHubConnect: share hubEncode, refs #38123

hgc.c and hgTables.c each had their own copy of hubEncode().  The two
bodies were identical, so move the function to hubConnect.c next to
isHubTrack() and let both CGIs call the one definition.

Also use cgiEncode() rather than htmlEncode() for the db= value in the
hgHubConnect assembly list.  That value goes in a query string, so
cgiEncode() is the right function there.  Genome names are already
limited to a safe character set, so this changes no output today.

diff --git src/hg/hgc/vcfClick.c src/hg/hgc/vcfClick.c
index 82592340666..20db79efdd0 100644
--- src/hg/hgc/vcfClick.c
+++ src/hg/hgc/vcfClick.c
@@ -1,27 +1,28 @@
 /* vcfTrack -- handlers for Variant Call Format data. */
 
 /* Copyright (C) 2014 The Regents of the University of California 
  * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
 
 #include "common.h"
 #include "dystring.h"
 #include "errCatch.h"
 #include "hCommon.h"
 #include "hdb.h"
 #include "hgc.h"
 #include "htmshell.h"
+#include "hubConnect.h"
 #include "jsHelper.h"
 #include "pgSnp.h"
 #include "regexHelper.h"
 #include "trashDir.h"
 #include "knetUdc.h"
 #include "udc.h"
 #include "vcf.h"
 #include "vcfUi.h"
 #include "trackHub.h"
 #include "featureBits.h"
 
 #define NA "<em>n/a</em>"
 
 static void printKeysWithDescriptions(struct vcfFile *vcff, int wordCount, char **words,
 				      struct vcfInfoDef *infoDefs, boolean stripToSymbol)