[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev [dev.15 patch] small textarea external edit buglet
From: |
brian j. pardy |
Subject: |
lynx-dev [dev.15 patch] small textarea external edit buglet |
Date: |
Thu, 28 Jan 1999 21:47:06 -0800 |
On Wed, Jan 27, 1999, Kim DeVaughn wrote:
> There are a few specific things (below) that I'd like some feedback on,
> but what is needed mostly, is additional testing ... particularly on
> the boundary cases (eg, the last line of a page is also the last line
> of a text area, and you add some lines, etc). I don't know HTML well
> enough to easily create such test pages. On the "live" pages that I
> have tested this on, I haven't seen any problems with the algorithms
> per se, though.
<URL:http://babelfish.altavista.com/> is the only textarea page I know
offhand, but this is repeatable:
Enter textarea, invoke editor, put in text, exit editor, all works
fine. But, using vim (haven't tried any other editors, but I expect
they would fail too), if I save a completely empty file, saving and
returning to Lynx will leave a few characters of garbage on the
screen. After the line "ebuf = malloc(1);", ebuf is read from without
ever initializing the memory.
This patch against dev.15 seems to fix it, though you may have a
better way of handling this.
*** 2.8.2dev.15/src/GridText.c Thu Jan 28 21:33:39 1999
--- 2.8.2dev.15.bri/src/GridText.c Thu Jan 28 21:34:39 1999
***************
*** 8822,8827 ****
--- 8822,8831 ----
while ((size != 0) && isspace(ebuf[size-1]))
ebuf[--size] = '\0';
+ if(size == 0) {
+ ebuf[0] = '\0';
+ }
+
/*
* Copy each line from the temp file into the corresponding anchor
* struct, removing any trailing whitespace. Add new lines to the
--
When you don't know what to do, walk fast and look worried.