0606090067a71fc8f713cf32ff0413e38f9236e3
braney
  Tue Jan 8 15:41:43 2013 -0800
fix bug in first fix in #9668 where hgGene crashed near the bottom of the page which is why no one caught it.  Also, added a little code to save position in cart after getting it from a gene name.
diff --git src/hg/hgGene/hgGene.c src/hg/hgGene/hgGene.c
index 4f9f854..0a32fba 100644
--- src/hg/hgGene/hgGene.c
+++ src/hg/hgGene/hgGene.c
@@ -659,30 +659,34 @@
     else if (cartVarExists(cart, hggDoOtherProteinSeq))
 	doOtherProteinSeq(conn, curGeneName);
     else if (cartVarExists(cart, hggDoOtherProteinAli))
 	doOtherProteinAli(conn, curGeneId, curGeneName);
     else
 	{
 	/* Default case - start fancy web page. */
 	cartWebStart(cart, database, "%s Gene %s (%s) Description and Page Index",
 	    genome, curGeneName, curGeneId);
 	webMain(conn);
 	cartWebEnd();
 	}
     hFreeConn(&spConn);
     hFreeConn(&conn);
     }
+/* load the cart with the position info we got from the gene name */
+char buffer[1024];
+safef(buffer, sizeof buffer,  "%s:%d-%d", curGeneChrom, curGeneStart+1, curGeneEnd);
+cartSetString(cart, "position", cloneString(buffer));
 cartRemovePrefix(cart, hggDoPrefix);
 }
 
 char *excludeVars[] = {"Submit", "submit", NULL};
 
 int main(int argc, char *argv[])
 /* Process command line. */
 {
 long enteredMainTime = clock1000();
 cgiSpoof(&argc, argv);
 htmlSetStyle(htmlStyleUndecoratedLink);
 if (argc != 1)
     usage();
 oldVars = hashNew(10);
 cartEmptyShell(cartMain, hUserCookie(), excludeVars, oldVars);