[w3m-dev-en 00216] Re: cannot map key 0

From: Hironori Sakamoto (h-saka@lsi.nec.co.jp)
Date: Tue Sep 12 2000 - 21:49:45 CDT

  • Next message: Richard Kilgore: "[w3m-dev-en 00217] Re: cannot map key 0"

    Hello,

    >> From: "Adam M. Costello" <amc@cs.berkeley.edu>
    >> My ~/.w3m/keymap contains the line:
    >> keymap 0 LINE_BEGIN
    >> This should cause behavior identical to vi, but it doesn't work.
    >> Perhaps 0 is misinterpreted as a count for a subsequent command, but no
    >> one would ever begin a count with 0.

    Try the following patch.
    In the patch, a bug fix for the array overflow when a 0x80-0xff character
    is inputed is also included.
    -----------------------------------
    Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
     http://www2u.biglobe.ne.jp/~hsaka/

    --- main.c.orig Wed Sep 13 11:19:07 2000
    +++ main.c Wed Sep 13 11:24:26 2000
    @@ -593,7 +593,7 @@
                 mouse_inactive();
     #endif /* MOUSE */
             if ((c & 0x80) == 0) { /* Ascii */
    - if (('0' <= c) && (c <= '9')) {
    + if (((prec_num && c == '0') || '1' <= c) && (c <= '9')) {
                     prec_num = prec_num * 10 + (int) (c - '0');
                     if (prec_num > PREC_LIMIT)
                         prec_num = PREC_LIMIT;
    @@ -661,7 +661,7 @@
     void
     pcmap(void)
     {
    - w3mFuncList[PcKeymap[getch()]].func ();
    + w3mFuncList[(int) PcKeymap[(int) getch()].func();
     }
     #else /* not __EMX__ */
     void pcmap(void)
    @@ -672,7 +672,10 @@
     void
     escmap(void)
     {
    - w3mFuncList[(int) EscKeymap[(int) getch()]].func();
    + char c;
    + c = getch();
    + if (! (c & 0x80))
    + w3mFuncList[(int) EscKeymap[(int) c]].func();
     }
     
     void
    @@ -683,7 +686,7 @@
     
         if (IS_DIGIT(c))
             escdmap(c);
    - else
    + else if (! (c & 0x80))
             w3mFuncList[(int) EscBKeymap[(int) c]].func();
     }
     



    This archive was generated by hypermail 2b29 : Tue Sep 12 2000 - 22:43:52 CDT