getenv: return NULL if empty #2574

Making an environment variable empty can be a way of unsetting it for
platforms that don't support unsetenv(). In most cases, we treat empty
variables as having been unset. For all others, use os_env_exists().
This commit is contained in:
Scott Prager
2015-05-03 09:25:53 -04:00
parent fa0f122221
commit 412d246be7
10 changed files with 67 additions and 60 deletions

View File

@@ -808,7 +808,7 @@ static void diff_file(char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff)
/* We don't want $DIFF_OPTIONS to get in the way. */
if (os_getenv("DIFF_OPTIONS")) {
vim_setenv("DIFF_OPTIONS", "");
os_unsetenv("DIFF_OPTIONS");
}
/* Build the diff command and execute it. Always use -a, binary