diff options
author | Mark Bainter <mbainter+github@gmail.com> | 2015-04-12 22:31:00 +0000 |
---|---|---|
committer | Mark Bainter <mbainter+github@gmail.com> | 2015-04-18 21:37:10 +0000 |
commit | a7e17de048b0791329cf1ad4d4c291290a99040a (patch) | |
tree | 39381ae903acab0bf818c7cce68fce1997d29255 /src/nvim/ex_cmds.c | |
parent | 08c08ecdf3c4837889d837dbe4a3ace0bd301ead (diff) | |
download | rneovim-a7e17de048b0791329cf1ad4d4c291290a99040a.tar.gz rneovim-a7e17de048b0791329cf1ad4d4c291290a99040a.tar.bz2 rneovim-a7e17de048b0791329cf1ad4d4c291290a99040a.zip |
Refactor get_env() to respect const qualifier
Without the casts*, the compiler rightly warns about the os_getenv
losing the qualifier. This refactor adds a variable to manage this
properly, and renames the original variables to increase clarity.
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index c40808b1f1..efb05d80fb 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -5061,7 +5061,6 @@ void fix_help_buffer(void) char_u *fname; char_u *p; char_u *rt; - bool mustfree; /* set filetype to "help". */ set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL); @@ -5116,8 +5115,7 @@ void fix_help_buffer(void) p = p_rtp; while (*p != NUL) { copy_option_part(&p, NameBuff, MAXPATHL, ","); - mustfree = FALSE; - rt = (char_u *)vim_getenv("VIMRUNTIME", &mustfree); + rt = (char_u *)vim_getenv("VIMRUNTIME"); if (path_full_compare(rt, NameBuff, FALSE) != kEqualFiles) { int fcount; char_u **fnames; @@ -5242,8 +5240,7 @@ void fix_help_buffer(void) FreeWild(fcount, fnames); } } - if (mustfree) - xfree(rt); + xfree(rt); } break; } |