mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 11:23:59 +08:00
Fix for crash on redirections
This commit is contained in:
parent
5fe7c065dc
commit
917b4ff8bc
|
@ -1085,7 +1085,10 @@ static void tokenize( const wchar_t * const buff, std::vector<int> &color, const
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
color.at(tok_get_pos( &tok )) = HIGHLIGHT_ERROR;
|
size_t pos = tok_get_pos(&tok);
|
||||||
|
if (pos < color.size()) {
|
||||||
|
color.at(pos) = HIGHLIGHT_ERROR;
|
||||||
|
}
|
||||||
if( error )
|
if( error )
|
||||||
error->push_back(L"Invalid redirection");
|
error->push_back(L"Invalid redirection");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user