Mercurial > vim
changeset 31904:a4358b58d3fb v9.0.1284
patch 9.0.1284: compiler warnings for uninitialized variables
Commit: https://github.com/vim/vim/commit/40b4872966d3886e7ff86184ae4ffb58704bf075
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 5 17:04:50 2023 +0000
patch 9.0.1284: compiler warnings for uninitialized variables
Problem: Compiler warnings for uninitialized variables. (Tony Mechelynck)
Solution: Add variable initializations.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 Feb 2023 18:15:03 +0100 |
parents | 1cedb94012da |
children | d919c7b5c568 |
files | src/option.c src/version.c |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/option.c +++ b/src/option.c @@ -2096,7 +2096,6 @@ do_set_option( char_u key_name[2]; int nextchar; // next non-white char after option name int afterchar; // character just after option name - int cp_val; char *errmsg = NULL; int key; int len; @@ -2167,6 +2166,7 @@ do_set_option( else { flags = P_STRING; + varp = NULL; if (key < 0) { key_name[0] = KEY2TERMCAP0(key); @@ -2183,10 +2183,10 @@ do_set_option( if (validate_opt_idx(opt_idx, opt_flags, flags, &errmsg) == FAIL) goto skip; + int cp_val = p_cp; if (vim_strchr((char_u *)"?=:!&<", nextchar) != NULL) { arg += len; - cp_val = p_cp; if (nextchar == '&' && arg[1] == 'v' && arg[2] == 'i') { if (arg[3] == 'm') // "opt&vim": set to Vim default