Patch 7.4.975
Problem:    Using ":sort" on a very big file sometimes causes text to be
            corrupted. (John Beckett)
Solution:   Copy the line into a buffer before calling ml_append().
Files:      src/ex_cmds.c


*** ../vim-7.4.974/src/ex_cmds.c        2015-11-10 21:05:45.309028557 +0100
--- src/ex_cmds.c       2015-12-17 13:00:53.896995875 +0100
***************
*** 540,549 ****
        if (!unique || i == 0
                || (sort_ic ? STRICMP(s, sortbuf1) : STRCMP(s, sortbuf1)) != 0)
        {
!           if (ml_append(lnum++, s, (colnr_T)0, FALSE) == FAIL)
                break;
-           if (unique)
-               STRCPY(sortbuf1, s);
        }
        fast_breakcheck();
        if (got_int)
--- 540,550 ----
        if (!unique || i == 0
                || (sort_ic ? STRICMP(s, sortbuf1) : STRCMP(s, sortbuf1)) != 0)
        {
!           /* Copy the line into a buffer, it may become invalid in
!            * ml_append(). And it's needed for "unique". */
!           STRCPY(sortbuf1, s);
!           if (ml_append(lnum++, sortbuf1, (colnr_T)0, FALSE) == FAIL)
                break;
        }
        fast_breakcheck();
        if (got_int)
*** ../vim-7.4.974/src/version.c        2015-12-17 15:03:51.303857910 +0100
--- src/version.c       2015-12-17 15:06:00.974494673 +0100
***************
*** 743,744 ****
--- 743,746 ----
  {   /* Add new patch number below this line */
+ /**/
+     975,
  /**/

-- 
Life would be so much easier if we could just look at the source code.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui