mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:41:15 -03:00
Reject empty variable names
This allowed `set "" foo`, which is bogus and results in an unusable variable.
This commit is contained in:
@@ -634,8 +634,9 @@ static int builtin_set_show(const wchar_t *cmd, const set_cmd_opts_t &opts, int
|
||||
wchar_t *arg = argv[i];
|
||||
|
||||
if (!valid_var_name(arg)) {
|
||||
streams.err.append_format(_(L"$%ls: invalid var name\n"), arg);
|
||||
continue;
|
||||
streams.err.append_format(BUILTIN_ERR_VARNAME, cmd, arg);
|
||||
builtin_print_error_trailer(parser, streams.err, cmd);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
|
||||
if (std::wcschr(arg, L'[')) {
|
||||
|
||||
Reference in New Issue
Block a user