mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 17:31:14 -03:00
Restore implicit cd for paths starting with ., .., or ~
This commit is contained in:
13
expand.cpp
13
expand.cpp
@@ -1351,22 +1351,13 @@ static wchar_t * expand_tilde_internal_compat( wchar_t *in )
|
||||
|
||||
void expand_tilde( wcstring &input)
|
||||
{
|
||||
if( input[0] == L'~' )
|
||||
if( ! input.empty() && input.at(0) == L'~' )
|
||||
{
|
||||
input[0] = HOME_DIRECTORY;
|
||||
input.at(0) = HOME_DIRECTORY;
|
||||
expand_tilde_internal( input );
|
||||
}
|
||||
}
|
||||
|
||||
wchar_t * expand_tilde_compat( wchar_t *input )
|
||||
{
|
||||
if (input[0] == L'~') {
|
||||
input[0] = HOME_DIRECTORY;
|
||||
return expand_tilde_internal_compat(input);
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
/**
|
||||
Remove any internal separators. Also optionally convert wildcard characters to
|
||||
regular equivalents. This is done to support EXPAND_SKIP_WILDCARDS.
|
||||
|
||||
Reference in New Issue
Block a user