lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev very long <title>; can we not overwrite or change ";" to "(


From: Henry Nelson
Subject: Re: lynx-dev very long <title>; can we not overwrite or change ";" to "(" ?
Date: Wed, 21 Aug 2002 21:52:51 +0900 (JST)

> Reading the code (src/GridText.c, display_title()), I only see it doing a
> truncation of the title string based on its length.  If your title contains
> non-ASCII text, it may therefore split one of the multibyte characters.

That was it.  Thanks a lot.  Actually the "fix" is already there, but
ifdefed with the SH extensions.  I think this is one case where Hiroyuki
Senshu's code should just replace what's there.  It is not CJK specific,
nor even multibyte specific, although it protects against the multibyte
case.  It indicates that a truncation has been made in a pleasing manner
by adding periods: ".. (p1 of 2)".

If it's agreeable to everyone, I made a little patch (appended).

BTW, if you're wondering why I use multibyte characters, it's because no
amount of "&nbsp;" will do the trick; always at least "Microsoft I..."
remains.  One line of the Japanese space character pushes M$ out of the
picture.  (Yippee.  Until M$ gets wind of it.)  Anyone know of a way to
do it with ascii and valid html?  Sure would be nice.

__Henry

patch to remove ifdefs and legacy code:

*** lynx2-8-5/src/GridText.c.orig       Wed May 29 04:41:42 2002
--- lynx2-8-5/src/GridText.c    Wed Aug 21 21:13:38 2002
***************
*** 1621,1631 ****
        LYmove(0, i);
      } else {
        /*
!        *  Note that this truncation is not taking into
!        *  account the possibility that multibyte
!        *  characters might be present. -FM
         */
- #ifdef SH_EX  /* 1999/06/15 (Tue) 10:17:28 */
        int last;
        last = (int)strlen(percent) + CHAR_WIDTH;
        if (limit - 3 >= last) {
--- 1621,1629 ----
        LYmove(0, i);
      } else {
        /*
!        *  Truncation takes into account the possibility that
!        *  multibyte characters might be present. -HS (H. Senshu)
         */
        int last;
        last = (int)strlen(percent) + CHAR_WIDTH;
        if (limit - 3 >= last) {
***************
*** 1635,1644 ****
        } else {
            title[(limit - 1) - last] = '\0';
        }
- #else
-       if ((i = ((limit - 2) - strlen(percent)) - CHAR_WIDTH) >= 0)
-           title[i] = '\0';
- #endif
        LYmove(0, CHAR_WIDTH);
      }
      LYaddstr(title);
--- 1633,1638 ----

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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