mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Fix for off-by-one error in tokenizer error message reporting
This commit is contained in:
parent
925fe65dd8
commit
5769fa6aed
1 changed files with 3 additions and 2 deletions
|
@ -64,7 +64,6 @@ static const wchar_t *tok_desc[] =
|
|||
{
|
||||
N_(L"Tokenizer not yet initialized"),
|
||||
N_(L"Tokenizer error"),
|
||||
N_(L"Invalid token"),
|
||||
N_(L"String"),
|
||||
N_(L"Pipe"),
|
||||
N_(L"End of command"),
|
||||
|
@ -77,6 +76,8 @@ static const wchar_t *tok_desc[] =
|
|||
N_(L"Comment")
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Set the latest tokens string to be the specified error message
|
||||
*/
|
||||
|
@ -559,7 +560,7 @@ static bool my_iswspace(wchar_t c)
|
|||
|
||||
const wchar_t *tok_get_desc(int type)
|
||||
{
|
||||
if (type < 0 || (size_t)type >= sizeof(tok_desc))
|
||||
if (type < 0 || (size_t)type >= (sizeof tok_desc / sizeof *tok_desc))
|
||||
{
|
||||
return _(L"Invalid token type");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue