|
1 To: [email protected] |
|
2 Subject: Patch 7.2.240 |
|
3 Fcc: outbox |
|
4 From: Bram Moolenaar <[email protected]> |
|
5 Mime-Version: 1.0 |
|
6 Content-Type: text/plain; charset=UTF-8 |
|
7 Content-Transfer-Encoding: 8bit |
|
8 ------------ |
|
9 |
|
10 Patch 7.2.240 |
|
11 Problem: Crash when using find/replace dialog repeatedly. (Michiel |
|
12 Hartsuiker) |
|
13 Solution: Avoid doing the operation while busy or recursively. Also refuse |
|
14 replace when text is locked. |
|
15 Files: src/gui.c |
|
16 |
|
17 |
|
18 *** ../vim-7.2.239/src/gui.c 2009-06-24 18:31:36.000000000 +0200 |
|
19 --- src/gui.c 2009-07-22 16:54:16.000000000 +0200 |
|
20 *************** |
|
21 *** 5004,5009 **** |
|
22 --- 5004,5022 ---- |
|
23 char_u *p; |
|
24 regmatch_T regmatch; |
|
25 int save_did_emsg = did_emsg; |
|
26 + static int busy = FALSE; |
|
27 + |
|
28 + /* When the screen is being updated we should not change buffers and |
|
29 + * windows structures, it may cause freed memory to be used. Also don't |
|
30 + * do this recursively (pressing "Find" quickly several times. */ |
|
31 + if (updating_screen || busy) |
|
32 + return FALSE; |
|
33 + |
|
34 + /* refuse replace when text cannot be changed */ |
|
35 + if ((type == FRD_REPLACE || type == FRD_REPLACEALL) && text_locked()) |
|
36 + return FALSE; |
|
37 + |
|
38 + busy = TRUE; |
|
39 |
|
40 ga_init2(&ga, 1, 100); |
|
41 if (type == FRD_REPLACEALL) |
|
42 *************** |
|
43 *** 5094,5099 **** |
|
44 --- 5107,5113 ---- |
|
45 } |
|
46 |
|
47 vim_free(ga.ga_data); |
|
48 + busy = FALSE; |
|
49 return (ga.ga_len > 0); |
|
50 } |
|
51 |
|
52 *** ../vim-7.2.239/src/version.c 2009-07-22 16:22:33.000000000 +0200 |
|
53 --- src/version.c 2009-07-29 11:09:13.000000000 +0200 |
|
54 *************** |
|
55 *** 678,679 **** |
|
56 --- 678,681 ---- |
|
57 { /* Add new patch number below this line */ |
|
58 + /**/ |
|
59 + 240, |
|
60 /**/ |
|
61 |
|
62 -- |
|
63 hundred-and-one symptoms of being an internet addict: |
|
64 113. You are asked about a bus schedule, you wonder if it is 16 or 32 bits. |
|
65 |
|
66 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ |
|
67 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
|
68 \\\ download, build and distribute -- http://www.A-A-P.org /// |
|
69 \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |