aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
authorMark Bainter <mbainter+github@gmail.com>2015-04-12 22:31:00 +0000
committerMark Bainter <mbainter+github@gmail.com>2015-04-18 21:37:10 +0000
commita7e17de048b0791329cf1ad4d4c291290a99040a (patch)
tree39381ae903acab0bf818c7cce68fce1997d29255 /src/nvim/main.c
parent08c08ecdf3c4837889d837dbe4a3ace0bd301ead (diff)
downloadrneovim-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/main.c')
-rw-r--r--src/nvim/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index ffa114ce19..af6e49ce48 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -829,18 +829,16 @@ static void init_locale(void)
# endif
{
- bool mustfree = false;
char_u *p;
/* expand_env() doesn't work yet, because chartab[] is not initialized
* yet, call vim_getenv() directly */
- p = (char_u *)vim_getenv("VIMRUNTIME", &mustfree);
+ p = (char_u *)vim_getenv("VIMRUNTIME");
if (p != NULL && *p != NUL) {
vim_snprintf((char *)NameBuff, MAXPATHL, "%s/lang", p);
bindtextdomain(VIMPACKAGE, (char *)NameBuff);
}
- if (mustfree)
- xfree(p);
+ xfree(p);
textdomain(VIMPACKAGE);
}
TIME_MSG("locale set");