d30337d436a490a59698f716c0defabe3f40035a
angie
  Tue May 3 13:05:38 2016 -0700
hgGateway wasn't initializing oldVars, so switching db via CGI led to keeping old position -- thanks Brian L!  refs #15277 note-257.

diff --git src/hg/hgGateway/hgGateway.c src/hg/hgGateway/hgGateway.c
index de34506..468fb6b 100644
--- src/hg/hgGateway/hgGateway.c
+++ src/hg/hgGateway/hgGateway.c
@@ -790,18 +790,21 @@
 jsonWriteFree(&jw);
 }
 
 int main(int argc, char *argv[])
 /* Process CGI / command line. */
 {
 /* Null terminated list of CGI Variables we don't want to save
  * permanently. */
 char *excludeVars[] = {SEARCH_TERM, CARTJSON_COMMAND, NULL,};
 cgiSpoof(&argc, argv);
 setUdcCacheDir();
 if (cgiOptionalString(SEARCH_TERM))
     // Skip the cart for speedy searches
     lookupTerm();
 else
+    {
+    oldVars = hashNew(10);
     cartEmptyShellNoContent(doMiddle, hUserCookie(), excludeVars, oldVars);
+    }
 return 0;
 }