Introduce env_stack_t

This will instance environment variable stacks.
This commit is contained in:
ridiculousfish
2018-09-09 12:17:31 -07:00
parent 391af6af0c
commit 8d7cae63ff
3 changed files with 170 additions and 53 deletions

View File

@@ -174,7 +174,7 @@ static bool pushd(const char *path) {
return false;
}
env_set_pwd_from_getcwd();
env_stack_t::principal().set_pwd_from_getcwd();
return true;
}
@@ -184,7 +184,7 @@ static void popd() {
err(L"chdir(\"%s\") from popd() failed: errno = %d", old_cwd.c_str(), errno);
}
pushed_dirs.pop_back();
env_set_pwd_from_getcwd();
env_stack_t::principal().set_pwd_from_getcwd();
}
// The odd formulation of these macros is to avoid "multiple unary operator" warnings from oclint