To: [email protected]
Subject: patch 5.5a.4
Fcc: outbox
From: Bram Moolenaar <[email protected]>
------------

Patch 5.5a.4
Problem:    When using whole-line completion in insert mode while the cursor
           is in the indent, get "out of memory" error. (Stekrt)
Solution:   Don't allocate a negative amount of memory in ins_complete().
Files:      src/edit.c


*** ../vim-5.5a.3/src/edit.c    Mon Aug 30 10:40:48 1999
--- src/edit.c  Wed Sep  1 12:07:18 1999
***************
*** 2792,2797 ****
--- 2792,2799 ----
       {
           tmp_ptr = skipwhite(ptr);
           temp = (int)complete_col - (tmp_ptr - ptr);
+           if (temp < 0)       /* cursor in indent: empty pattern */
+               temp = 0;
           complete_pat = vim_strnsave(tmp_ptr, temp);
           if (complete_pat == NULL)
               return FALSE;
*** ../vim-5.5a.3/src/version.c Wed Sep  1 17:58:10 1999
--- src/version.c       Wed Sep  1 18:00:20 1999
***************
*** 420,420 ****
--- 420,421 ----
 {   /* Add new patch number below this line */
+     4,

--
The question is:  What do you do with your life?
The wrong answer is: Be the richest guy in the graveyard.
                               (billionaire and Oracle founder Larry Ellison)

--/-/---- Bram Moolenaar ---- [email protected] ---- [email protected] ---\-\--
 \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /