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/synonym.c src/hg/hgGene/synonym.c
index feab9ee..680ea30 100644
--- src/hg/hgGene/synonym.c
+++ src/hg/hgGene/synonym.c
@@ -341,37 +341,35 @@
         {
     	hPrintf("<B>Representative RNA: </B> <A HREF=\"");
     	printOurMrnaUrl(stdout, mrnaAcc);
     	hPrintf("\">%s</A><BR>\n", mrnaAcc);
     	}
     else
     /* do not show URL link if it is not found in gbCdnaInfo */
     	{
     	hPrintf("<B>Representative RNA: %s </B>", mrnaAcc);
     	}
     }
 if (protAcc != NULL)
     {
     kgProteinID = cloneString("");
     if (hTableExists(sqlGetDatabase(conn), "knownGene")
-        && (isNotEmpty(cartOptionalString(cart, hggChrom)) &&
-	      differentWord(cartOptionalString(cart, hggChrom),"none")))
+        && (isNotEmpty(curGeneChrom) &&
+	      differentWord(curGeneChrom,"none")))
     	{
-    	safef(condStr, sizeof(condStr), "name = '%s' and chrom = '%s' and txStart=%s and txEnd=%s", 
-	        id, cartOptionalString(cart, hggChrom), 
-    	        cartOptionalString(cart, hggStart), 
-		cartOptionalString(cart, hggEnd));
+    	safef(condStr, sizeof(condStr), "name = '%s' and chrom = '%s' and txStart=%d and txEnd=%d", 
+	        id, curGeneChrom, curGeneStart, curGeneEnd);
     	kgProteinID = sqlGetField(database, "knownGene", "proteinID", condStr);
     	}
 
     hPrintf("<B>Protein: ");
     if (strstr(kgProteinID, "-") != NULL)
         {
 	parAcc = cloneString(kgProteinID);
 	chp = strstr(parAcc, "-");
 	*chp = '\0';
 	
         /* show variant splice protein and the UniProt link here */
 	hPrintf("<A HREF=\"http://www.uniprot.org/uniprot%s\" "
 	    "TARGET=_blank>%s</A></B>, splice isoform of ",
 	    kgProteinID, kgProteinID);
         hPrintf("<A HREF=\"http://www.uniprot.org/uniprot/%s\" "