diff -rub orig/lynx2.8.9dev.16\src\GridText.c lynx2.8.9dev.16\src\GridText.c
--- orig/lynx2.8.9dev.16\src\GridText.c	Tue Jul 04 10:27:07 2017
+++ lynx2.8.9dev.16\src\GridText.c	Sat Sep 09 12:20:50 2017
@@ -4306,7 +4306,7 @@
 	      - ctrl_chars_on_this_line);
 
     if ((
-#ifndef USE_SLANG
+#if !defined(USE_SLANG) && !defined(PDCURSES)
 	    (text->permissible_split
 #ifdef USE_CURSES_PADS
 	     || !LYwideLines
diff -rub orig/lynx2.8.9dev.16\src\HTFWriter.c lynx2.8.9dev.16\src\HTFWriter.c
--- orig/lynx2.8.9dev.16\src\HTFWriter.c	Sun Jul 02 13:42:32 2017
+++ lynx2.8.9dev.16\src\HTFWriter.c	Sat Sep 09 12:18:59 2017
@@ -177,7 +177,7 @@
 		    CAST_off_t (me->anchor->actual_length),
 		    actual));
 	    if (success) {
-		if (rename(copied, in_name) == 0)
+		if (LYRenameFile(copied, in_name) == 0)
 		    me->anchor->actual_length = (off_t) actual;
 		LYRemoveTemp(copied);
 	    }
@@ -200,7 +200,7 @@
 
 		strcpy(expanded, copied);
 		*strrchr(expanded, '.') = '\0';
-		if (rename(expanded, in_name) != 0) {
+		if (LYRenameFile(expanded, in_name) != 0) {
 		    CTRACE((tfp, "rename failed %s to %s\n", expanded, in_name));
 		} else if (stat(in_name, &stat_buf) != 0) {
 		    CTRACE((tfp, "stat failed for %s\n", in_name));
@@ -364,7 +364,7 @@
 			    new_path[off] = '.';
 			    if (strlen(new_path + off) > 4)
 				new_path[off + 4] = '\0';
-			    if (rename(path, new_path) == 0) {
+			    if (LYRenameFile(path, new_path) == 0) {
 				FREE(path);
 				path = new_path;
 			    } else {
diff -rub orig/lynx2.8.9dev.16\src\HTInit.c lynx2.8.9dev.16\src\HTInit.c
--- orig/lynx2.8.9dev.16\src\HTInit.c	Thu Nov 24 08:35:29 2016
+++ lynx2.8.9dev.16\src\HTInit.c	Sat Sep 09 12:18:56 2017
@@ -701,8 +701,10 @@
 	if (escaped) {
 	    escaped = 0;
 	    HTChunkPutc(cmd, UCH(*from));
+#if 0
 	} else if (*from == ESCAPE) {
 	    escaped = 1;
+#endif
 	} else if (prefixed) {
 	    prefixed = 0;
 	    switch (*from) {
diff -rub orig/lynx2.8.9dev.16\src\LYCurses.c lynx2.8.9dev.16\src\LYCurses.c
--- orig/lynx2.8.9dev.16\src\LYCurses.c	Sun Apr 30 10:52:12 2017
+++ lynx2.8.9dev.16\src\LYCurses.c	Sat Sep 09 12:21:00 2017
@@ -970,6 +970,23 @@
 int saved_scrsize_y2 = 0;
 int saved_winpos_x2 = 0;
 int saved_winpos_y2 = 0;
+
+int LYresize_term(int nlines, int ncols)
+{
+#ifdef _WINDOWS
+    HANDLE hConsole;
+    CONSOLE_SCREEN_BUFFER_INFO csbi;
+    SMALL_RECT srWindowRect;
+
+    hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
+    GetConsoleScreenBufferInfo(hConsole, &csbi);
+    srWindowRect.Right  = min(ncols , csbi.dwSize.X) - 1;
+    srWindowRect.Bottom = min(nlines, csbi.dwSize.Y) - 1;
+    srWindowRect.Left   = srWindowRect.Top = (SHORT)0;
+    SetConsoleWindowInfo( hConsole, TRUE, &srWindowRect);
+#endif
+    return resize_term(nlines, ncols);
+}
 #endif
 
 #ifdef USE_MAXSCREEN_TOGGLE
@@ -1077,64 +1094,35 @@
 
 void maxmizeWindowSize(void)
 {
-    int disp_height, disp_width, win_height, win_width;
     RECT winrect;
-    DWORD pid;
-    int font_width, font_height;
+    HANDLE hConsole;
+    COORD coordScreen;    
 
     setCurrentWindowHandle();
     if (currentWindowHandle == NULL) {
 	return;
     }
-    GetWindowThreadProcessId(currentWindowHandle, &pid);
-    disp_width = GetSystemMetrics(SM_CXFULLSCREEN);
-    disp_height = GetSystemMetrics(SM_CYFULLSCREEN);
     GetWindowRect(currentWindowHandle, &winrect);
-    win_width = winrect.right - winrect.left;
-    win_height = winrect.bottom - winrect.top;
     saved_winpos_x2 = winrect.left;
     saved_winpos_y2 = winrect.top;
 
-    if ((win_width <= disp_width) && (win_height <= disp_height)) {
-	GetClientRect(currentWindowHandle, &winrect);
-	win_width = winrect.right - winrect.left;
-	win_height = winrect.bottom - winrect.top;
-	CTRACE((tfp, "Current Rect: (%4d,%4d,%3d,%3d), ",
-		(int) winrect.left, (int) winrect.right,
-		(int) winrect.top, (int) winrect.bottom));
-	CTRACE((tfp, "Size: (%4d,%3d)\n", win_width, win_height));
+    hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
+    coordScreen = GetLargestConsoleWindowSize(hConsole);
 
-	if (scrsize_x == 0) {
-	    scrsize_x = COLS;
-	    scrsize_y = LINES + 1;
-	}
-	if ((scrsize_x == 0) || (scrsize_y == 0)) {
-	    CTRACE((tfp, "Illegal value: scrsize_x=%d, scrsize_y=%d\n",
-		    scrsize_x, scrsize_y));
-	} else {
-	    font_width = win_width / scrsize_x;
-	    font_height = win_height / scrsize_y;
-	    CTRACE((tfp, "Font Size: (%2d,%2d)\n", font_width, font_height));
-	    if ((font_width == 0) || (font_height == 0)) {
-		CTRACE((tfp, "Illegal font size.\n"));
-	    } else {
-		LYcols = scrsize_x = (disp_width - 4) / font_width;
-		LYlines = scrsize_y = (disp_height - 32) / font_height;
+    LYcols  = scrsize_x = coordScreen.X - 1;
+    LYlines = scrsize_y = coordScreen.Y - 1;
 		LYlines--;
 		CTRACE((tfp, "Request maximum screen size: %dx%d\n",
-			scrsize_y, scrsize_x));
-		resize_term(scrsize_y, scrsize_x);
+	    scrsize_x, scrsize_y));
+    LYresize_term(scrsize_y, scrsize_x);
 		Sleep(100);
 		moveWindowHXY(currentWindowHandle, 0, 0);
 		LYlines = LYscreenHeight();
 		LYcols = LYscreenWidth();
 		CTRACE((tfp, "...actual maximum screen size: %dx%d\n",
-			LYlines, LYcols));
+	    LYcols, LYlines));
 		LYStatusLine = -1;
 		recent_sizechange = TRUE;
-	    }
-	}
-    }
 }
 
 void recoverWindowSize(void)
@@ -1146,7 +1134,7 @@
 	LYStatusLine = -1;
 	wclear(curscr);
 	doupdate();
-	resize_term(scrsize_y, scrsize_x);
+	LYresize_term(scrsize_y, scrsize_x);
 
 	setCurrentWindowHandle();
 	if (currentWindowHandle != NULL) {
@@ -1389,7 +1377,7 @@
 	size_change(0);
 	recent_sizechange = FALSE;	/* prevent mainloop drawing 1st doc twice */
 #endif /* SIGWINCH */
-	CTRACE((tfp, "Screen size is now %d x %d\n", LYlines, LYcols));
+	CTRACE((tfp, "Screen size is now %d x %d\n", LYcols, LYlines));
 
 #ifdef USE_CURSES_PADS
 	if (LYuseCursesPads) {
@@ -1560,7 +1548,7 @@
 	}
 	CTRACE((tfp, "resize_term: x=%d, y=%d\n", scrsize_x, scrsize_y));
 	CTRACE((tfp, "saved terminal size: x=%d, y=%d\n", saved_scrsize_x, saved_scrsize_y));
-	resize_term(scrsize_y, scrsize_x);
+	LYresize_term(scrsize_y, scrsize_x);
 	LYlines = LYscreenHeight();
 	LYcols = LYscreenWidth();
 	LYStatusLine = -1;
diff -rub orig/lynx2.8.9dev.16\src\LYMain.c lynx2.8.9dev.16\src\LYMain.c
--- orig/lynx2.8.9dev.16\src\LYMain.c	Mon Jul 03 16:31:21 2017
+++ lynx2.8.9dev.16\src\LYMain.c	Sat Sep 09 12:21:00 2017
@@ -2227,7 +2227,7 @@
 	status = mainloop();
 	LYCloseCloset(RECALL_URL);
 	LYCloseCloset(RECALL_MAIL);
-#if defined(PDCURSES) && defined(PDC_BUILD) && PDC_BUILD >= 2401
+#if 0 /* defined(PDCURSES) && defined(PDC_BUILD) && PDC_BUILD >= 2401 */
 	if (!isendwin()) {
 	    if ((saved_scrsize_x != 0) && (saved_scrsize_y != 0)) {
 		resize_term(saved_scrsize_y, saved_scrsize_x);
@@ -3307,11 +3307,11 @@
 	    if ((scrsize_x <= 1) || (scrsize_y <= 1)) {
 		scrsize_x = scrsize_y = 0;
 	    }
-	    if ((scrsize_x > 0) && (scrsize_x < 80)) {
-		scrsize_x = 80;
+	    if ((scrsize_x > 0) && (scrsize_x < 40)) {
+		scrsize_x = 40;
 	    }
-	    if ((scrsize_y > 0) && (scrsize_y < 4)) {
-		scrsize_y = 4;
+	    if ((scrsize_y > 0) && (scrsize_y < 6)) {
+		scrsize_y = 6;
 	    }
 	    CTRACE((tfp, "scrsize: x=%d, y=%d\n", scrsize_x, scrsize_y));
 	}
diff -rub orig/lynx2.8.9dev.16\src\LYMainLoop.c lynx2.8.9dev.16\src\LYMainLoop.c
--- orig/lynx2.8.9dev.16\src\LYMainLoop.c	Sun Jul 02 13:04:20 2017
+++ lynx2.8.9dev.16\src\LYMainLoop.c	Sat Sep 09 12:19:08 2017
@@ -2165,7 +2165,8 @@
 		    }
 		    return 0;
 		}
-		if (isLYNXOPTIONS(links[curdoc.link].l_form->submit_action)) {
+		if (isEmpty(links[curdoc.link].l_form->submit_action) ||
+		    isLYNXOPTIONS(links[curdoc.link].l_form->submit_action)) {
 		    if (*old_c != real_c) {
 			*old_c = real_c;
 			HTUserMsg(NO_DOWNLOAD_SPECIAL);
@@ -6725,7 +6726,7 @@
 		    p = links[curdoc.link].lname;
 		}
 
-		if (strlen(p) < (sizeof(sjis_buff) / 10)) {
+		if (strlen(p) < ((sizeof(sjis_buff) / 2)-1)) {
 		    strcpy(temp_buff, p);
 		    if (StrChr(temp_buff, '%')) {
 			HTUnEscape(temp_buff);
diff -rub orig/lynx2.8.9dev.16\src\LYStrings.c lynx2.8.9dev.16\src\LYStrings.c
--- orig/lynx2.8.9dev.16\src\LYStrings.c	Wed May 10 15:11:33 2017
+++ lynx2.8.9dev.16\src\LYStrings.c	Sat Sep 09 12:19:02 2017
@@ -3186,6 +3186,7 @@
     /*
      * ch is (presumably) printable character.
      */
+#if 0
     if (remains < 0) {
 	overflow = 1;
 	len = 0;
@@ -3194,6 +3195,7 @@
 	else
 	    goto finish;
     }
+#endif
     ExtendEditor(edit, length + len);
     Buffer[length + len] = '\0';
     for (; length >= EditAt; length--)	/* Make room */
diff -rub orig/lynx2.8.9dev.16\src\LYUtils.c lynx2.8.9dev.16\src\LYUtils.c
--- orig/lynx2.8.9dev.16\src\LYUtils.c	Sun Jul 02 13:42:32 2017
+++ lynx2.8.9dev.16\src\LYUtils.c	Sat Sep 09 12:18:59 2017
@@ -7099,6 +7099,25 @@
 }
 
 /*
+ * Rename a file
+ */
+int LYRenameFile(char *src,
+		char *dst)
+{
+#ifdef _WINDOWS
+    /* 
+     * If dest_file exists prior to calling rename(), rename() will fail on Windows platforms.
+     * https://www.securecoding.cert.org/confluence/display/c/FIO10-C.+Take+care+when+using+the+rename%28%29+function
+     */
+    struct stat st;
+    if (stat(dst, &st) == 0) {
+	unlink(dst);
+    }
+#endif
+    return rename(src, dst);
+}
+
+/*
  * Copy a file
  */
 int LYCopyFile(char *src,
diff -rub orig/lynx2.8.9dev.16\src\LYUtils.h lynx2.8.9dev.16\src\LYUtils.h
--- orig/lynx2.8.9dev.16\src\LYUtils.h	Thu Jul 24 15:10:20 2014
+++ lynx2.8.9dev.16\src\LYUtils.h	Sat Sep 09 12:18:59 2017
@@ -166,6 +166,7 @@
     extern const char *wwwName(const char *pathname);
     extern int HTCheckForInterrupt(void);
     extern int LYConsoleInputFD(int need_selectable);
+    extern int LYRenameFile(char *src, char *dst);
     extern int LYCopyFile(char *src, char *dst);
     extern int LYGetHilitePos(int cur, int count);
     extern int LYRemoveTemp(char *name);
diff -rub orig/lynx2.8.9dev.16\WWW\Library\Implementation\HTTP.c lynx2.8.9dev.16\WWW\Library\Implementation\HTTP.c
--- orig/lynx2.8.9dev.16\WWW\Library\Implementation\HTTP.c	Thu Nov 24 16:56:50 2016
+++ lynx2.8.9dev.16\WWW\Library\Implementation\HTTP.c	Sat Sep 09 12:20:54 2017
@@ -223,6 +223,9 @@
 #if defined(USE_PROGRAM_DIR)
 	    else {
 		HTSprintf0(&(certfile), "%s\\cert.pem", program_dir);
+		if (!LYCanReadFile(certfile)) {
+		    HTSprintf0(&(certfile), "%s\\cacert.pem", program_dir);
+		}
 		CTRACE((tfp,
 			"HTGetSSLHandle: certfile is set to %s by installed directory\n", certfile));
 	    }
