]>
Commit | Line | Data |
---|---|---|
dbf7c229 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.0.077 | |
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 7.0.077 | |
11 | Problem: ":unlet v:this_session" causes a crash. (Marius Roets) | |
12 | Solution: When trying to unlet a fixed variable give an error message. | |
13 | Files: src/eval.c | |
14 | ||
15 | ||
16 | *** ../vim-7.0.076/src/eval.c Tue Aug 29 21:59:25 2006 | |
17 | --- src/eval.c Sat Sep 2 13:43:20 2006 | |
18 | *************** | |
19 | *** 701,706 **** | |
20 | --- 701,707 ---- | |
21 | static void list_one_var_a __ARGS((char_u *prefix, char_u *name, int type, char_u *string)); | |
22 | static void set_var __ARGS((char_u *name, typval_T *varp, int copy)); | |
23 | static int var_check_ro __ARGS((int flags, char_u *name)); | |
24 | + static int var_check_fixed __ARGS((int flags, char_u *name)); | |
25 | static int tv_check_lock __ARGS((int lock, char_u *name)); | |
26 | static void copy_tv __ARGS((typval_T *from, typval_T *to)); | |
27 | static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID)); | |
28 | *************** | |
29 | *** 3364,3369 **** | |
30 | --- 3365,3372 ---- | |
31 | hi = hash_find(ht, varname); | |
32 | if (!HASHITEM_EMPTY(hi)) | |
33 | { | |
34 | + if (var_check_fixed(HI2DI(hi)->di_flags, name)) | |
35 | + return FAIL; | |
36 | if (var_check_ro(HI2DI(hi)->di_flags, name)) | |
37 | return FAIL; | |
38 | delete_var(ht, hi); | |
39 | *************** | |
40 | *** 17818,17824 **** | |
41 | } | |
42 | ||
43 | /* | |
44 | ! * Return TRUE if di_flags "flags" indicate read-only variable "name". | |
45 | * Also give an error message. | |
46 | */ | |
47 | static int | |
48 | --- 17821,17827 ---- | |
49 | } | |
50 | ||
51 | /* | |
52 | ! * Return TRUE if di_flags "flags" indicates variable "name" is read-only. | |
53 | * Also give an error message. | |
54 | */ | |
55 | static int | |
56 | *************** | |
57 | *** 17834,17839 **** | |
58 | --- 17837,17859 ---- | |
59 | if ((flags & DI_FLAGS_RO_SBX) && sandbox) | |
60 | { | |
61 | EMSG2(_(e_readonlysbx), name); | |
62 | + return TRUE; | |
63 | + } | |
64 | + return FALSE; | |
65 | + } | |
66 | + | |
67 | + /* | |
68 | + * Return TRUE if di_flags "flags" indicates variable "name" is fixed. | |
69 | + * Also give an error message. | |
70 | + */ | |
71 | + static int | |
72 | + var_check_fixed(flags, name) | |
73 | + int flags; | |
74 | + char_u *name; | |
75 | + { | |
76 | + if (flags & DI_FLAGS_FIX) | |
77 | + { | |
78 | + EMSG2(_("E795: Cannot delete variable %s"), name); | |
79 | return TRUE; | |
80 | } | |
81 | return FALSE; | |
82 | *** ../vim-7.0.076/src/version.c Tue Aug 29 22:35:11 2006 | |
83 | --- src/version.c Sat Sep 2 13:39:36 2006 | |
84 | *************** | |
85 | *** 668,669 **** | |
86 | --- 668,671 ---- | |
87 | { /* Add new patch number below this line */ | |
88 | + /**/ | |
89 | + 77, | |
90 | /**/ | |
91 | ||
92 | -- | |
93 | ### Hiroshima 45, Chernobyl 86, Windows 95 ### | |
94 | ||
95 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
96 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
97 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
98 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |