]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.265
- new
[packages/vim.git] / 7.3.265
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.265
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.3.265
11 Problem:    When storing a pattern in search history there is no proper check
12             for the separator character.
13 Solution:   Pass the separator character to in_history(). (Muraoka Taro)
14 Files:      src/ex_getln.c
15
16
17 *** ../vim-7.3.264/src/ex_getln.c       2011-07-07 16:44:33.000000000 +0200
18 --- src/ex_getln.c      2011-07-27 17:50:35.000000000 +0200
19 ***************
20 *** 67,73 ****
21   
22   static int    hist_char2type __ARGS((int c));
23   
24 ! static int    in_history __ARGS((int, char_u *, int));
25   # ifdef FEAT_EVAL
26   static int    calc_hist_idx __ARGS((int histype, int num));
27   # endif
28 --- 67,73 ----
29   
30   static int    hist_char2type __ARGS((int c));
31   
32 ! static int    in_history __ARGS((int, char_u *, int, int));
33   # ifdef FEAT_EVAL
34   static int    calc_hist_idx __ARGS((int histype, int num));
35   # endif
36 ***************
37 *** 5289,5301 ****
38    * If 'move_to_front' is TRUE, matching entry is moved to end of history.
39    */
40       static int
41 ! in_history(type, str, move_to_front)
42       int           type;
43       char_u  *str;
44       int           move_to_front;      /* Move the entry to the front if it exists */
45   {
46       int           i;
47       int           last_i = -1;
48   
49       if (hisidx[type] < 0)
50         return FALSE;
51 --- 5289,5303 ----
52    * If 'move_to_front' is TRUE, matching entry is moved to end of history.
53    */
54       static int
55 ! in_history(type, str, move_to_front, sep)
56       int           type;
57       char_u  *str;
58       int           move_to_front;      /* Move the entry to the front if it exists */
59 +     int           sep;
60   {
61       int           i;
62       int           last_i = -1;
63 +     char_u  *p;
64   
65       if (hisidx[type] < 0)
66         return FALSE;
67 ***************
68 *** 5304,5310 ****
69       {
70         if (history[type][i].hisstr == NULL)
71             return FALSE;
72 !       if (STRCMP(str, history[type][i].hisstr) == 0)
73         {
74             if (!move_to_front)
75                 return TRUE;
76 --- 5306,5317 ----
77       {
78         if (history[type][i].hisstr == NULL)
79             return FALSE;
80
81 !       /* For search history, check that the separator character matches as
82 !        * well. */
83 !       p = history[type][i].hisstr;
84 !       if (STRCMP(str, p) == 0
85 !               && (type != HIST_SEARCH || sep == p[STRLEN(p) + 1]))
86         {
87             if (!move_to_front)
88                 return TRUE;
89 ***************
90 *** 5398,5404 ****
91         }
92         last_maptick = -1;
93       }
94 !     if (!in_history(histype, new_entry, TRUE))
95       {
96         if (++hisidx[histype] == hislen)
97             hisidx[histype] = 0;
98 --- 5405,5411 ----
99         }
100         last_maptick = -1;
101       }
102 !     if (!in_history(histype, new_entry, TRUE, sep))
103       {
104         if (++hisidx[histype] == hislen)
105             hisidx[histype] = 0;
106 ***************
107 *** 5977,5983 ****
108         if (val != NULL && *val != NUL)
109         {
110             if (!in_history(type, val + (type == HIST_SEARCH),
111 !                                                       viminfo_add_at_front))
112             {
113                 /* Need to re-allocate to append the separator byte. */
114                 len = STRLEN(val);
115 --- 5984,5990 ----
116         if (val != NULL && *val != NUL)
117         {
118             if (!in_history(type, val + (type == HIST_SEARCH),
119 !                                                 viminfo_add_at_front, *val))
120             {
121                 /* Need to re-allocate to append the separator byte. */
122                 len = STRLEN(val);
123 *** ../vim-7.3.264/src/version.c        2011-07-27 17:31:42.000000000 +0200
124 --- src/version.c       2011-07-27 17:58:22.000000000 +0200
125 ***************
126 *** 711,712 ****
127 --- 711,714 ----
128   {   /* Add new patch number below this line */
129 + /**/
130 +     265,
131   /**/
132
133 -- 
134     [clop clop]
135 MORTICIAN:  Who's that then?
136 CUSTOMER:   I don't know.
137 MORTICIAN:  Must be a king.
138 CUSTOMER:   Why?
139 MORTICIAN:  He hasn't got shit all over him.
140                                   The Quest for the Holy Grail (Monty Python)
141
142  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
143 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
144 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
145  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.033704 seconds and 3 git commands to generate.