Don't call expand_home_directory from within parser_t::test - it may hang

https://github.com/fish-shell/fish-shell/issues/512
This commit is contained in:
ridiculousfish
2013-01-12 12:53:40 -08:00
parent e9c226b8be
commit b32fcc7a8e
3 changed files with 10 additions and 4 deletions

View File

@@ -3061,8 +3061,10 @@ int parser_t::test(const wchar_t * buff,
arg_count=0;
command = tok_last(&tok);
has_command = expand_one(command, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_VARIABLES);
if (!has_command)
// Pass SKIP_HOME_DIRECTORIES for https://github.com/fish-shell/fish-shell/issues/512
has_command = expand_one(command, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_VARIABLES | EXPAND_SKIP_HOME_DIRECTORIES);
if (! has_command)
{
command = L"";
err=1;