mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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().
This commit is contained in:
@@ -540,10 +540,11 @@ ex_sort(eap)
|
|||||||
if (!unique || i == 0
|
if (!unique || i == 0
|
||||||
|| (sort_ic ? STRICMP(s, sortbuf1) : STRCMP(s, sortbuf1)) != 0)
|
|| (sort_ic ? STRICMP(s, sortbuf1) : STRCMP(s, sortbuf1)) != 0)
|
||||||
{
|
{
|
||||||
if (ml_append(lnum++, s, (colnr_T)0, FALSE) == FAIL)
|
/* Copy the line into a buffer, it may become invalid in
|
||||||
break;
|
* ml_append(). And it's needed for "unique". */
|
||||||
if (unique)
|
|
||||||
STRCPY(sortbuf1, s);
|
STRCPY(sortbuf1, s);
|
||||||
|
if (ml_append(lnum++, sortbuf1, (colnr_T)0, FALSE) == FAIL)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
fast_breakcheck();
|
fast_breakcheck();
|
||||||
if (got_int)
|
if (got_int)
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
975,
|
||||||
/**/
|
/**/
|
||||||
974,
|
974,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user