Instantize env_get_pwd_slash

This requires threading environment_t through many places, such as completions
and history. We introduce null_environment_t for when the environment isn't
important.
This commit is contained in:
ridiculousfish
2018-09-10 22:29:52 -07:00
parent 26fc705c07
commit 421fbdd52a
15 changed files with 127 additions and 76 deletions

View File

@@ -19,6 +19,7 @@
#include "future_feature_flags.h"
#include "parse_constants.h"
#include "parse_util.h"
#include "parser.h"
#include "tnode.h"
#include "tokenizer.h"
#include "util.h"
@@ -1131,8 +1132,8 @@ static bool detect_errors_in_plain_statement(const wcstring &buff_src,
if (maybe_t<wcstring> unexp_command = command_for_plain_statement(pst, buff_src)) {
wcstring command;
// Check that we can expand the command.
if (expand_to_command_and_args(*unexp_command, &command, nullptr, parse_errors) ==
EXPAND_ERROR) {
if (expand_to_command_and_args(*unexp_command, null_environment_t{}, &command, nullptr,
parse_errors) == EXPAND_ERROR) {
errored = true;
}