4db0b922300631fc32d34c5b5ac010018723905e
chmalee
  Mon Sep 8 13:57:08 2025 -0700
Fix misplaced htmlClose call in table browser set user regions, refs #36284

diff --git src/hg/hgTables/userRegions.c src/hg/hgTables/userRegions.c
index 739107714f8..c0f07edfb39 100644
--- src/hg/hgTables/userRegions.c
+++ src/hg/hgTables/userRegions.c
@@ -37,38 +37,38 @@
 hPrintf("Paste regions:");
 hPrintf("</TD><TD ALIGN=RIGHT>");
 hPrintf("Or upload file: <INPUT TYPE=FILE NAME=\"%s\">&nbsp;<BR>\n",
 	hgtaEnteredUserRegionFile);
 hPrintf("</TD></TR><TR><TD COLSPAN=2 ALIGN=LEFT>\n");
 cgiMakeTextArea(hgtaEnteredUserRegions, oldPasted, 10, 70);
 hPrintf("</TD></TR><TR><TD COLSPAN=2 ALIGN=LEFT>\n");
 cgiMakeButton(hgtaDoSubmitUserRegions, "Submit");
 hPrintf("&nbsp;");
 cgiMakeButton(hgtaDoClearSetUserRegionsText, "Clear");
 hPrintf("&nbsp;");
 cgiMakeButton(hgtaDoMainPage, "Cancel");
 hPrintf("</TD></TR></TABLE>");
 hPrintf("</FORM><BR>\n");
 webIncludeHelpFile("hgTbUserRegionsHelp", FALSE);
-htmlClose();
 }
 
 void doSetUserRegions(struct sqlConnection *conn)
 /* Respond to set regions button. */
 {
 htmlOpen("Enter region definition\n");
 doSetUserRegionsAfterOpen(conn);
+htmlClose();
 }
 
 static char *limitText(char *text)
 /* read text string and limit to maxRegions actual data lines */
 {
 struct dyString *limitedText = dyStringNew(0);
 /* Even if using FALSE for zTerm, lineFile still does a memmove when it hits the end
  * and thus clobbers the string, so call lineFileOnString on a copy: */
 char copy[strlen(text)+1];
 safecpy(copy, sizeof(copy), text);
 struct lineFile *lf = lineFileOnString("limitText", FALSE, copy);
 char *lineStart = NULL;
 int lineLength = 0;
 int legitimateLineCount = 0;
 while (legitimateLineCount < maxRegions && lineFileNext(lf, &lineStart, &lineLength))