]> git.pld-linux.org Git - packages/vim.git/blob - 6.2.105
- initial import
[packages/vim.git] / 6.2.105
1 To: vim-dev@vim.org
2 Subject: Patch 6.2.105
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 6.2.105
11 Problem:    When the cursor is past the end of the line when calling
12             get_c_indent() a crash might occur.
13 Solution:   Don't look past the end of the line. (NJ Verenini)
14 Files:      src/misc1.c
15
16
17 *** ../vim-6.2.104/src/misc1.c  Sat Sep 27 19:36:47 2003
18 --- src/misc1.c Fri Sep 26 22:09:58 2003
19 ***************
20 *** 5064,5076 ****
21       }
22   
23       /* remember where the cursor was when we started */
24
25       cur_curpos = curwin->w_cursor;
26   
27 !     /* get the current contents of the line.
28        * This is required, because only the most recent line obtained with
29        * ml_get is valid! */
30
31       linecopy = vim_strsave(ml_get(cur_curpos.lnum));
32       if (linecopy == NULL)
33         return 0;
34 --- 5064,5074 ----
35       }
36   
37       /* remember where the cursor was when we started */
38       cur_curpos = curwin->w_cursor;
39   
40 !     /* Get a copy of the current contents of the line.
41        * This is required, because only the most recent line obtained with
42        * ml_get is valid! */
43       linecopy = vim_strsave(ml_get(cur_curpos.lnum));
44       if (linecopy == NULL)
45         return 0;
46 ***************
47 *** 5079,5086 ****
48        * In insert mode and the cursor is on a ')' truncate the line at the
49        * cursor position.  We don't want to line up with the matching '(' when
50        * inserting new stuff.
51        */
52 !     if ((State & INSERT) && linecopy[curwin->w_cursor.col] == ')')
53         linecopy[curwin->w_cursor.col] = NUL;
54   
55       theline = skipwhite(linecopy);
56 --- 5077,5088 ----
57        * In insert mode and the cursor is on a ')' truncate the line at the
58        * cursor position.  We don't want to line up with the matching '(' when
59        * inserting new stuff.
60 +      * For unknown reasons the cursor might be past the end of the line, thus
61 +      * check for that.
62        */
63 !     if ((State & INSERT)
64 !           && curwin->w_cursor.col < STRLEN(linecopy)
65 !           && linecopy[curwin->w_cursor.col] == ')')
66         linecopy[curwin->w_cursor.col] = NUL;
67   
68       theline = skipwhite(linecopy);
69 *** ../vim-6.2.104/src/version.c        Sat Sep 27 19:42:53 2003
70 --- src/version.c       Sat Sep 27 19:44:37 2003
71 ***************
72 *** 632,633 ****
73 --- 638,641 ----
74   {   /* Add new patch number below this line */
75 + /**/
76 +     105,
77   /**/
78
79 -- 
80 hundred-and-one symptoms of being an internet addict:
81 37. You start looking for hot HTML addresses in public restrooms.
82
83  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
84 ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
85 \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
86  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
This page took 0.03605 seconds and 3 git commands to generate.