Mercurial > vim
annotate src/proto/option.pro @ 27221:165a799b4129 v8.2.4139
patch 8.2.4139: using freed memory in expression abbreviation
Commit: https://github.com/vim/vim/commit/94075b2b0e8e3b75334799d2c082497fbf85ffa1
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 18 20:30:39 2022 +0000
patch 8.2.4139: using freed memory in expression abbreviation
Problem: Using freed memory if an expression abbreviation deletes the
abbreviation.
Solution: Do not access the pointer after evaluating the expression.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 18 Jan 2022 21:45:02 +0100 |
parents | 164d59ddd48a |
children | 9e0ac05f579a |
rev | line source |
---|---|
7 | 1 /* option.c */ |
13361
65c29bd4548b
patch 8.0.1554: custom plugins loaded with --clean
Christian Brabandt <cb@256bit.org>
parents:
11764
diff
changeset
|
2 void set_init_1(int clean_arg); |
24912
02fa8d72e4e3
patch 8.2.2993: 'fileencodings' default value should depend on 'encoding'
Bram Moolenaar <Bram@vim.org>
parents:
23422
diff
changeset
|
3 void set_fencs_unicode(void); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
4 void set_string_default(char *name, char_u *val); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
5 void set_number_default(char *name, long val); |
17845
b6acc24df7de
patch 8.1.1919: using window options when passing a buffer to popup_create()
Bram Moolenaar <Bram@vim.org>
parents:
17789
diff
changeset
|
6 void set_local_options_default(win_T *wp, int do_buffer); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
7 void free_all_options(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
8 void set_init_2(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
9 void set_init_3(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
10 void set_helplang_default(char_u *lang); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
11 void set_title_defaults(void); |
19137
69f0e9b5c107
patch 8.2.0128: cannot list options one per line
Bram Moolenaar <Bram@vim.org>
parents:
18679
diff
changeset
|
12 void ex_set(exarg_T *eap); |
26175
6b4f017d7005
patch 8.2.3619: cannot use a lambda for 'operatorfunc'
Bram Moolenaar <Bram@vim.org>
parents:
25380
diff
changeset
|
13 int do_set(char_u *arg_start, int opt_flags); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
14 void did_set_option(int opt_idx, int opt_flags, int new_value, int value_checked); |
11764
b82dad3fa176
patch 8.0.0764: 'termkey' does not work yet
Christian Brabandt <cb@256bit.org>
parents:
9858
diff
changeset
|
15 int string_to_key(char_u *arg, int multi_byte); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
16 void did_set_title(void); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
17 void set_options_bin(int oldval, int newval, int opt_flags); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
18 void check_options(void); |
14867
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14748
diff
changeset
|
19 int get_term_opt_idx(char_u **p); |
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14748
diff
changeset
|
20 int set_term_option_alloced(char_u **p); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
21 int was_set_insecurely(char_u *opt, int opt_flags); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
22 void redraw_titles(void); |
17940
079e10a49ea1
patch 8.1.1966: some code in options.c fits better elsewhere
Bram Moolenaar <Bram@vim.org>
parents:
17845
diff
changeset
|
23 int valid_name(char_u *val, char *allowed); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
24 void set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx); |
14867
cf4d6489c9eb
patch 8.1.0445: setting 'term' does not store location for termcap options
Christian Brabandt <cb@256bit.org>
parents:
14748
diff
changeset
|
25 void set_term_option_sctx_idx(char *name, int opt_idx); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
26 void check_redraw(long_u flags); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
27 int findoption(char_u *arg); |
26441
65ab0b035dd8
patch 8.2.3751: cannot assign a lambda to an option that takes a function
Bram Moolenaar <Bram@vim.org>
parents:
26175
diff
changeset
|
28 getoption_T get_option_value(char_u *name, long *numval, char_u **stringval, int *flagsp, int scope); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
29 int get_option_value_strict(char_u *name, long *numval, char_u **stringval, int opt_type, void *from); |
18156
c81370b3ede4
patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents:
18100
diff
changeset
|
30 char_u *option_iter_next(void **option, int opt_type); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
31 long_u get_option_flags(int opt_idx); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
32 void set_option_flag(int opt_idx, long_u flag); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
33 void clear_option_flag(int opt_idx, long_u flag); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
34 int is_global_option(int opt_idx); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
35 int is_global_local_option(int opt_idx); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
36 int is_window_local_option(int opt_idx); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
37 int is_hidden_option(int opt_idx); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
38 int is_crypt_key_option(int opt_idx); |
15470
55ccc2d353bd
patch 8.1.0743: giving error messages is not flexible
Bram Moolenaar <Bram@vim.org>
parents:
15062
diff
changeset
|
39 char *set_option_value(char_u *name, long number, char_u *string, int opt_flags); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
40 char_u *get_term_code(char_u *tname); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
41 char_u *get_highlight_default(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
42 char_u *get_encoding_default(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
43 int makeset(FILE *fd, int opt_flags, int local_only); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
44 int makefoldset(FILE *fd); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
45 void clear_termoptions(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
46 void free_termoptions(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
47 void free_one_termoption(char_u *var); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
48 void set_term_defaults(void); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
49 int istermoption_idx(int opt_idx); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
50 void unset_global_local_option(char_u *name, void *from); |
26441
65ab0b035dd8
patch 8.2.3751: cannot assign a lambda to an option that takes a function
Bram Moolenaar <Bram@vim.org>
parents:
26175
diff
changeset
|
51 char_u *get_option_varp_scope(int opt_idx, int scope); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
52 char_u *get_option_var(int opt_idx); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
53 char_u *get_option_fullname(int opt_idx); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
54 char_u *get_equalprg(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
55 void win_copy_options(win_T *wp_from, win_T *wp_to); |
18156
c81370b3ede4
patch 8.1.2073: when editing a buffer 'colorcolumn' may not work
Bram Moolenaar <Bram@vim.org>
parents:
18100
diff
changeset
|
56 void after_copy_winopt(win_T *wp); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
57 void copy_winopt(winopt_T *from, winopt_T *to); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
58 void clear_winopt(winopt_T *wop); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
59 void buf_copy_options(buf_T *buf, int flags); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
60 void reset_modifiable(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
61 void set_iminsert_global(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
62 void set_imsearch_global(void); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
63 void set_context_in_set_cmd(expand_T *xp, char_u *arg, int opt_flags); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
64 int ExpandSettings(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
65 int ExpandOldSetting(int *num_file, char_u ***file); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
66 int shortmess(int x); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
67 void vimrc_found(char_u *fname, char_u *envname); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
68 void change_compatible(int on); |
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
69 int option_was_set(char_u *name); |
14748
00da090af0ab
patch 8.1.0386: cannot test with non-default option value
Christian Brabandt <cb@256bit.org>
parents:
14736
diff
changeset
|
70 int reset_option_was_set(char_u *name); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
71 void fill_breakat_flags(void); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
72 int can_bs(int what); |
15713
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15470
diff
changeset
|
73 long get_scrolloff_value(void); |
ad8b2c109b22
patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff'
Bram Moolenaar <Bram@vim.org>
parents:
15470
diff
changeset
|
74 long get_sidescrolloff_value(void); |
7668
21b0a39d13ed
commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents:
6243
diff
changeset
|
75 unsigned int get_bkc_value(buf_T *buf); |
27128
164d59ddd48a
patch 8.2.4093: cached breakindent values not initialized properly
Bram Moolenaar <Bram@vim.org>
parents:
26441
diff
changeset
|
76 char_u *get_flp_value(buf_T *buf); |
25380
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
24912
diff
changeset
|
77 unsigned int get_ve_flags(void); |
18574
8b0114ffde2b
patch 8.1.2281: 'showbreak' cannot be set for one window
Bram Moolenaar <Bram@vim.org>
parents:
18156
diff
changeset
|
78 char_u *get_showbreak_value(win_T *win); |
9858
3e96d9ed2ca1
commit https://github.com/vim/vim/commit/b5ae48e9ffd3b8eb6ca4057de11f1bddcde8ce6f
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
79 dict_T *get_winbuf_options(int bufopt); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
17940
diff
changeset
|
80 int fill_culopt_flags(char_u *val, win_T *wp); |
23272
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
20237
diff
changeset
|
81 int magic_isset(void); |
26175
6b4f017d7005
patch 8.2.3619: cannot use a lambda for 'operatorfunc'
Bram Moolenaar <Bram@vim.org>
parents:
25380
diff
changeset
|
82 int option_set_callback_func(char_u *optval, callback_T *optcb); |
7 | 83 /* vim: set ft=c : */ |