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 <[email protected]>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Lynx-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lynx-dev

Reply via email to