Dominique Pelle wrote:
> On Feb 18, 2008 8:59 AM, Patrick Texier <[EMAIL PROTECTED]> wrote:
>
> > I'm using vim 7.1.252 (huge) on Linux (enc=tenc=latin1).
> >
> > When I call :sort with only one line in a buffer, the line is erased.
> >
> > vim -u NONE
> >
> > iOne line<ESC>
> > :sort
> >
> > I get:
> >
> > ~<[EMAIL PROTECTED]
>
> For me, the line completely disappears (which is not right either).
> I'm using Vim 7.1.252 on Linux (huge, enc=fenc=utf8)
>
> Valgrind memory checker sees a problem when sorting only 1 line:
>
> ==8855== Invalid read of size 1
> ==8855== at 0x4C22F92: strlen (mc_replace_strmem.c:242)
> ==8855== by 0x4B70BD: ml_append_int (memline.c:2235)
> ==8855== by 0x4B6F9C: ml_append (memline.c:2179)
> ==8855== by 0x44FEFB: ex_sort (ex_cmds.c:522)
> ==8855== by 0x463CBE: do_one_cmd (ex_docmd.c:2623)
> ==8855== by 0x4614BD: do_cmdline (ex_docmd.c:1099)
> ==8855== by 0x4EBE41: nv_colon (normal.c:5179)
> ==8855== by 0x4E4E47: normal_cmd (normal.c:1152)
> ==8855== by 0x4A5C35: main_loop (main.c:1181)
> ==8855== by 0x4A5781: main (main.c:940)
> ==8855== Address 0xb9bb468 is 0 bytes inside a block of size 9 free'd
> ==8855== at 0x4C21B6E: free (vg_replace_malloc.c:323)
> ==8855== by 0x4D4E4A: vim_free (misc2.c:1580)
> ==8855== by 0x4B8FA7: ml_flush_line (memline.c:3149)
> ==8855== by 0x4B6F79: ml_append (memline.c:2178)
> ==8855== by 0x44FEFB: ex_sort (ex_cmds.c:522)
> ==8855== by 0x463CBE: do_one_cmd (ex_docmd.c:2623)
> ==8855== by 0x4614BD: do_cmdline (ex_docmd.c:1099)
> ==8855== by 0x4EBE41: nv_colon (normal.c:5179)
> ==8855== by 0x4E4E47: normal_cmd (normal.c:1152)
> ==8855== by 0x4A5C35: main_loop (main.c:1181)
> ==8855== by 0x4A5781: main (main.c:940)
>
> Attached is a patch which fixes it.
Thanks!
--
What a wonderfully exciting cough! Do you mind if I join you?
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---