Dominique Pellé wrote:
> Cesar Romani wrote:
>
>> 1675                if ((error_msg = tgetent_error(tbuf, term)) == NULL)
>> (gdb) p term
>> $11 = (char_u *) 0xa0158c0 "msys"
>> (gdb) n
>> 1677                    tp = tstrbuf;
>> (gdb) p term
>> $12 = (char_u *) 0x5b455c3d <Address 0x5b455c3d out of bounds>
>
>
> 1/ OK, so the corruption happens in in tgetent_error(), most likely
> in line 2158 but it might be worth putting a breaking point at line
> term.c:2158 and print 'term' variable before & after executing
> line term.c:2158 to confirm that corruption happens there.
>
> 2151     static char_u *
> 2152 tgetent_error(tbuf, term)
> 2153     char_u  *tbuf;
> 2154     char_u  *term;
> 2155 {
> 2156     int     i;
> 2157
> 2158     i = TGETENT(tbuf, term);
> 2159     if (i < 0               /* -1 is always an error */
> 2160 # ifdef TGETENT_ZERO_ERR
> 2161             || i == 0       /* sometimes zero is also an error */
> 2162 # endif
> 2163        )

Breakpoint 1, tgetent_error (tbuf=0x22f834 "¤ú\"", term=0xa0158c0 "msys")
    at term.c:2158
2158        i = TGETENT(tbuf, term);
(gdb) p term
$1 = (char_u *) 0xa0158c0 "msys"
(gdb) n
2159        if (i < 0               /* -1 is always an error */
(gdb) p term
$2 = (char_u *) 0xa0158c0 "msys"
(gdb) n
2181        return NULL;
(gdb) p term
$3 = (char_u *) 0xa0158c0 "msys"
(gdb) n
2182    }
(gdb) p term
$4 = (char_u *) 0xa0158c0 "msys"
(gdb) n
set_termname (term=0x5b455c3d <Address 0x5b455c3d out of bounds>)
    at term.c:1677
1677                    tp = tstrbuf;
(gdb) p term
$5 = (char_u *) 0x5b455c3d <Address 0x5b455c3d out of bounds>

> 2/ Most likely not enough memory is allocated for tbuf, first
> parameter of tgetent().  Size of buffer is defined in vim.h as follows:
>
> 1348 #if defined(AMIGA) || defined(__linux__) || defined(__QNX__) ||
> defined(__CYGWIN32__) || defined(_AIX)
> 1349 # define TBUFSZ 2048            /* buffer size for termcap entry
> */
> 1350 #else
> 1351 # define TBUFSZ 1024            /* buffer size for termcap entry */
> 1352 #endif
>
>
> I suspect that on your system (mingw), it's using 1024 instead
> of 2048. If so, the attached patch might fix it.  It adds
> "defined(__MINGW32__)"  (__MINGW32__ is already used
> in several places in Vim's code):
>
> 1348 #if defined(AMIGA) || defined(__linux__) || defined(__QNX__) ||
> defined(_AIX) \
> 1349   || defined(__CYGWIN32__) || defined(__MINGW32__)
> 1350 # define TBUFSZ 2048            /* buffer size for termcap entry
> */
> 1351 #else
> 1352 # define TBUFSZ 1024            /* buffer size for termcap entry */
> 1353 #endif

Your patch works only if I change __MINGW32__ by __MSYS__ or if I add
|| defined(__MSYS__)

There is one problem: The backspace key doesn't delete the precedent
character. That was also the case on the console before applying the
patch.
On the old vim version installed on the system the backspace key works
fine.

Regards,
Cesar


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui