4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
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)
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
23 /* remember where the cursor was when we started */
25 cur_curpos = curwin->w_cursor;
27 ! /* get the current contents of the line.
28 * This is required, because only the most recent line obtained with
31 linecopy = vim_strsave(ml_get(cur_curpos.lnum));
37 /* remember where the cursor was when we started */
38 cur_curpos = curwin->w_cursor;
40 ! /* Get a copy of the current contents of the line.
41 * This is required, because only the most recent line obtained with
43 linecopy = vim_strsave(ml_get(cur_curpos.lnum));
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.
52 ! if ((State & INSERT) && linecopy[curwin->w_cursor.col] == ')')
53 linecopy[curwin->w_cursor.col] = NUL;
55 theline = skipwhite(linecopy);
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
63 ! if ((State & INSERT)
64 ! && curwin->w_cursor.col < STRLEN(linecopy)
65 ! && linecopy[curwin->w_cursor.col] == ')')
66 linecopy[curwin->w_cursor.col] = NUL;
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
74 { /* Add new patch number below this line */
80 hundred-and-one symptoms of being an internet addict:
81 37. You start looking for hot HTML addresses in public restrooms.
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 ///