Apply by doing:
cd /usr/src
patch -p0 < 034_lynx.patch
Then rebuild and install lynx:
cd gnu/usr.bin/lynx
make -f Makefile.bsd-wrapper obj
make -f Makefile.bsd-wrapper
make -f Makefile.bsd-wrapper install
Index: gnu/usr.bin/lynx/userdefs.h
===================================================================
RCS file: /cvs/src/gnu/usr.bin/lynx/userdefs.h,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -p -r1.5 -r1.5.2.1
--- gnu/usr.bin/lynx/userdefs.h 1 May 2003 18:59:36 -0000 1.5
+++ gnu/usr.bin/lynx/userdefs.h 6 Nov 2004 04:19:28 -0000 1.5.2.1
@@ -1370,6 +1370,8 @@
#define MAXCHARSETS 60 /* max character sets supported */
#define TRST_MAXROWSPAN 10000 /* max rowspan accepted by TRST code */
#define TRST_MAXCOLSPAN 1000 /* max colspan and COL/COLGROUP span accepted */
+#define MAX_TABLE_ROWS 200 /* max rows for tables */
+#define MAX_TABLE_COLS 200 /* max cols for tables */
#define SAVE_TIME_NOT_SPACE /* minimize number of some malloc calls */
/* Win32 may support more, but old win16 helper apps may not. */
Index: gnu/usr.bin/lynx/src/GridText.c
===================================================================
RCS file: /cvs/src/gnu/usr.bin/lynx/src/GridText.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -p -r1.3 -r1.3.2.1
--- gnu/usr.bin/lynx/src/GridText.c 1 May 2003 18:59:38 -0000 1.3
+++ gnu/usr.bin/lynx/src/GridText.c 6 Nov 2004 04:19:29 -0000 1.3.2.1
@@ -9270,8 +9270,8 @@ PUBLIC int HText_beginInput ARGS3(
/*
* Set SIZE.
*/
- if (I->size != NULL) {
- f->size = atoi(I->size);
+ if (I->size != 0) {
+ f->size = I->size;
/*
* Leave at zero for option lists.
*/
Index: gnu/usr.bin/lynx/src/HTForms.h
===================================================================
RCS file: /cvs/src/gnu/usr.bin/lynx/src/HTForms.h,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -p -r1.3 -r1.3.2.1
--- gnu/usr.bin/lynx/src/HTForms.h 1 May 2003 18:59:38 -0000 1.3
+++ gnu/usr.bin/lynx/src/HTForms.h 6 Nov 2004 04:19:29 -0000 1.3.2.1
@@ -40,7 +40,7 @@ typedef struct _InputFieldData {
CONST char *md;
CONST char *min;
CONST char *name;
- CONST char *size;
+ int size;
CONST char *src;
CONST char *type;
char *value;
Index: gnu/usr.bin/lynx/src/HTML.c
===================================================================
RCS file: /cvs/src/gnu/usr.bin/lynx/src/HTML.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -p -r1.3 -r1.3.2.1
--- gnu/usr.bin/lynx/src/HTML.c 1 May 2003 18:59:38 -0000 1.3
+++ gnu/usr.bin/lynx/src/HTML.c 6 Nov 2004 04:19:29 -0000 1.3.2.1
@@ -84,6 +84,19 @@
#define STACKLEVEL(me) ((me->stack + MAX_NESTING - 1) - me->sp)
+#define DFT_TEXTAREA_COLS 60
+#define DFT_TEXTAREA_ROWS 4
+
+#define MAX_TEXTAREA_COLS LYcolLimit
+#define MAX_TEXTAREA_ROWS (3 * LYlines)
+
+#define LimitValue(name, value) \
+ if (name > value) { \
+ CTRACE((tfp, "Limited " #name " to %d, was %d\n", \
+ value, name)); \
+ name = value; \
+ }
+
extern BOOL HTPassEightBitRaw;
extern BOOLEAN HT_Is_Gopher_URL;
@@ -4709,7 +4722,7 @@ PRIVATE int HTML_start_element ARGS6(
I.align=NULL; I.accept=NULL; I.checked=NO; I.class=NULL;
I.disabled=NO; I.error=NULL; I.height= NULL; I.id=NULL;
I.lang=NULL; I.max=NULL; I.maxlength=NULL; I.md=NULL;
- I.min=NULL; I.name=NULL; I.size=NULL; I.src=NULL;
+ I.min=NULL; I.name=NULL; I.size=0; I.src=NULL;
I.type=NULL; I.value=NULL; I.width=NULL;
I.accept_cs = NULL;
I.name_cs = ATTR_CS_IN;
@@ -4895,7 +4908,7 @@ PRIVATE int HTML_start_element ARGS6(
I.align=NULL; I.accept=NULL; I.checked=NO; I.class=NULL;
I.disabled=NO; I.error=NULL; I.height= NULL; I.id=NULL;
I.lang=NULL; I.max=NULL; I.maxlength=NULL; I.md=NULL;
- I.min=NULL; I.name=NULL; I.size=NULL; I.src=NULL;
+ I.min=NULL; I.name=NULL; I.size=0; I.src=NULL;
I.type=NULL; I.value=NULL; I.width=NULL;
I.accept_cs = NULL;
I.name_cs = ATTR_CS_IN;
@@ -5199,7 +5212,7 @@ PRIVATE int HTML_start_element ARGS6(
I.checked = YES;
if (present && present[HTML_INPUT_SIZE] &&
value[HTML_INPUT_SIZE] && *value[HTML_INPUT_SIZE])
- I.size = value[HTML_INPUT_SIZE];
+ I.size = atoi(value[HTML_INPUT_SIZE]);
if (present && present[HTML_INPUT_MAXLENGTH] &&
value[HTML_INPUT_MAXLENGTH] && *value[HTML_INPUT_MAXLENGTH])
I.maxlength = value[HTML_INPUT_MAXLENGTH];
@@ -5430,26 +5443,28 @@ PRIVATE int HTML_start_element ARGS6(
if (present && present[HTML_TEXTAREA_COLS] &&
value[HTML_TEXTAREA_COLS] &&
isdigit(UCH(*value[HTML_TEXTAREA_COLS])))
- StrAllocCopy(me->textarea_cols, value[HTML_TEXTAREA_COLS]);
+ me->textarea_cols = atoi(value[HTML_TEXTAREA_COLS]);
else {
int width;
width = LYcols - 1 -
me->new_style->leftIndent - me->new_style->rightIndent;
if (dump_output_immediately) /* don't waste too much for this */
- width = HTMIN(width, 60);
+ width = HTMIN(width, DFT_TEXTAREA_COLS);
if (width > 1 && (width-1)*6 < MAX_LINE - 3 -
me->new_style->leftIndent - me->new_style->rightIndent)
- HTSprintf0(&me->textarea_cols, "%d", width);
+ me->textarea_cols = width;
else
- StrAllocCopy(me->textarea_cols, "60");
+ me->textarea_cols = DFT_TEXTAREA_COLS;
}
+ LimitValue(me->textarea_cols, MAX_TEXTAREA_COLS);
if (present && present[HTML_TEXTAREA_ROWS] &&
value[HTML_TEXTAREA_ROWS] &&
isdigit(UCH(*value[HTML_TEXTAREA_ROWS])))
me->textarea_rows = atoi(value[HTML_TEXTAREA_ROWS]);
else
- me->textarea_rows = 4;
+ me->textarea_rows = DFT_TEXTAREA_ROWS;
+ LimitValue(me->textarea_rows, MAX_TEXTAREA_ROWS);
if (present && present[HTML_TEXTAREA_DISABLED])
me->textarea_disabled = YES;
@@ -5566,7 +5581,7 @@ PRIVATE int HTML_start_element ARGS6(
I.align=NULL; I.accept=NULL; I.checked=NO; I.class=NULL;
I.disabled=NO; I.error=NULL; I.height= NULL; I.id=NULL;
I.lang=NULL; I.max=NULL; I.maxlength=NULL; I.md=NULL;
- I.min=NULL; I.name=NULL; I.size=NULL; I.src=NULL;
+ I.min=NULL; I.name=NULL; I.size=0; I.src=NULL;
I.type=NULL; I.value=NULL; I.width=NULL;
I.accept_cs = NULL;
I.name_cs = -1;
@@ -7231,7 +7246,7 @@ End_Object:
I.align=NULL; I.accept=NULL; I.checked=NO; I.class=NULL;
I.disabled=NO; I.error=NULL; I.height= NULL; I.id=NULL;
I.lang=NULL; I.max=NULL; I.maxlength=NULL; I.md=NULL;
- I.min=NULL; I.name=NULL; I.size=NULL; I.src=NULL;
+ I.min=NULL; I.name=NULL; I.size=0; I.src=NULL;
I.type=NULL; I.value=NULL; I.width=NULL;
I.value_cs = current_char_set;
@@ -7382,7 +7397,7 @@ End_Object:
}
I.value = temp;
chars = HText_beginInput(me->text, me->inUnderline, &I);
- for (chars = atoi(me->textarea_cols); chars > 0; chars--)
+ for (chars = me->textarea_cols; chars > 0; chars--)
HTML_put_character(me, '_');
HText_appendCharacter(me->text, '\r');
if (*data == '\n') {
@@ -7407,7 +7422,6 @@ End_Object:
HTChunkClear(&me->textarea);
FREE(me->textarea_name);
me->textarea_name_cs = -1;
- FREE(me->textarea_cols);
FREE(me->textarea_id);
break;
}
@@ -7964,7 +7978,6 @@ PRIVATE void HTML_abort ARGS2(HTStructur
FREE(me->map_address);
FREE(me->textarea_name);
FREE(me->textarea_accept_cs);
- FREE(me->textarea_cols);
FREE(me->textarea_id);
FREE(me->LastOptionValue);
FREE(me->xinclude);
@@ -8142,7 +8155,7 @@ PUBLIC HTStructured* HTML_new ARGS3(
me->textarea_name = NULL;
me->textarea_name_cs = -1;
me->textarea_accept_cs = NULL;
- me->textarea_cols = NULL;
+ me->textarea_cols = 0;
me->textarea_rows = 4;
me->textarea_disabled = NO;
me->textarea_id = NULL;
Index: gnu/usr.bin/lynx/src/HTML.h
===================================================================
RCS file: /cvs/src/gnu/usr.bin/lynx/src/HTML.h,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -p -r1.3 -r1.3.2.1
--- gnu/usr.bin/lynx/src/HTML.h 1 May 2003 18:59:39 -0000 1.3
+++ gnu/usr.bin/lynx/src/HTML.h 6 Nov 2004 04:19:29 -0000 1.3.2.1
@@ -104,7 +104,7 @@ struct _HTStructured {
char * textarea_name;
int textarea_name_cs;
char * textarea_accept_cs;
- char * textarea_cols;
+ int textarea_cols;
int textarea_rows;
int textarea_disabled;
char * textarea_id;
Index: gnu/usr.bin/lynx/src/LYCurses.h
===================================================================
RCS file: /cvs/src/gnu/usr.bin/lynx/src/LYCurses.h,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -p -r1.3 -r1.3.2.1
--- gnu/usr.bin/lynx/src/LYCurses.h 1 May 2003 18:59:39 -0000 1.3
+++ gnu/usr.bin/lynx/src/LYCurses.h 6 Nov 2004 04:19:29 -0000 1.3.2.1
@@ -311,6 +311,24 @@ extern WINDOW *LYstartPopup PARAMS((int
extern int LYlines; /* replaces LINES */
extern int LYcols; /* replaces COLS */
+/*
+ * The scrollbar, if used, occupies the rightmost column.
+ */
+#ifdef USE_SCROLLBAR
+#define LYbarWidth (LYShowScrollbar ? 1 : 0)
+#else
+#define LYbarWidth 0
+#endif
+
+/*
+ * Usable limits for display:
+ */
+#if defined(FANCY_CURSES) || defined(USE_SLANG)
+#define LYcolLimit (LYcols - LYbarWidth)
+#else
+#define LYcolLimit (LYcols - 1)
+#endif
+
#ifdef USE_CURSES_PADS
extern WINDOW *LYwin;
extern int LYshiftWin;