lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev Lynx (2.8.2rel.1) botches input type=submit value= w/spaces


From: Klaus Weide
Subject: Re: lynx-dev Lynx (2.8.2rel.1) botches input type=submit value= w/spaces
Date: Tue, 10 Aug 1999 03:34:03 -0500 (CDT)

On Mon, 9 Aug 1999, Heather wrote:

> I'd love to hear from someone what the reasoning was, at least so its 
> importance can be slipped into the code comments.  Since you say it's not 
> accident, but don't know the reason, I assume the patch of code has either 
> confusing or no comments.  If someone remembers the reason it's probably
> important enough to note.  (This doesn't preclude it being important and
> nobody remembers or knows, but would be some strength to its defense anyway.)


The relevant section is this in HTML.c:

                if (me->UsePlainSpace == TRUE) {
                    /*
                     *  Convert any newlines or tabs to spaces,
                     *  and trim any lead or trailing spaces. - FM
                     */
                    convert_to_spaces(I.value, FALSE);
                    while (I.value && I.value[0] == ' ')
                        I.value++;
                    len = strlen(I.value) - 1;
                    while (len > 0 && I.value[len] == ' ')
                        I.value[len--] = '\0';
                }
                me->UsePlainSpace = FALSE;

where me->UsePlainSpace is TRUE for INPUT types "text", "image", "submit",
and "reset" and, with EXP_FILE_UPLOAD, "file", but not for others.

We could just skip the two while loops for type="submit" (or possibly
more).  I am not sure it is a good idea.  For type="submit" I.value is
used for the string displayed as well as for the value submitted.
The motivation for the trimming may have been for the string displayed
or for the value submitted or both.  Maybe we should trim for the button
displayed (somewhat in line with collapsing speces e.g. in IMG ALT
attributes) but not for the value submitted, but separating the two
functions could be a bit tricky - it may not be worth the effort.

    Klaus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]