From a7e17de048b0791329cf1ad4d4c291290a99040a Mon Sep 17 00:00:00 2001 From: Mark Bainter Date: Sun, 12 Apr 2015 22:31:00 +0000 Subject: 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. --- src/nvim/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/nvim/main.c') 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"); -- cgit