[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lynx-dev] Bug in single-line text fields edited with an external ed
From: |
Thomas Dickey |
Subject: |
Re: [Lynx-dev] Bug in single-line text fields edited with an external editor? |
Date: |
Sun, 09 Sep 2012 14:48:52 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Sun, Sep 02, 2012 at 06:59:15PM -0400, Keith Bowes wrote:
> This happens to me especially when I'm writing a new blog post. I press
> ^Xe to start up Vim (so I can have spell checking) and then when I'm
> finished with the external editor, Lynx truncates the text to the number
> of characters specified by the
> size attribute minus 1. If you type it without invoking an external
> editor, it works fine. I know the ultimate hack would be just to dig
> into the source code of the blogging platform I use and specify a size
> long enough to fit a blog-post title, but that wouldn't solve the full
> breadth of the defect. I have tried to fix the bug itself, but I really
> can't make heads or tails out of the Lynx source code, e.g. where the
> external editor is invoked, how and why the text is truncated, etc.
in GridText.c:
if ((ebuf = readEditedFile(ed_temp)) != 0) {
/*
* Only use the first line of the result, and only that up to
* the size of the field.
*/
for (p = ebuf; *p != '\0'; ++p) {
if ((p - ebuf) >= form->size - 1) {
*p = '\0';
break;
} else if (*p == '\n' || *p == '\r') {
*p = '\0';
break;
}
}
StrAllocCopy(form->value, ebuf);
FREE(ebuf);
}
(taking out the limit based on form->size sounds okay to me)
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature