mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 06:41:42 +08:00
don't die if read
is invoked with no var names
Partial fix for #4220 by restoring the old behavior if no var name was provided. But we still set an empty var if a var name was provided.
This commit is contained in:
parent
8f22def8f7
commit
71af1a9566
|
@ -398,7 +398,9 @@ int builtin_read(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||
if (optind == argc || exit_res != STATUS_CMD_OK) {
|
||||
// Define the var without any data. We do this because when this happens we want the user to
|
||||
// be able to use the var but have it expand to nothing.
|
||||
env_set(argv[optind], NULL, opts.place);
|
||||
//
|
||||
// TODO: For fish 3.0 we should mandate at least one var name.
|
||||
if (argv[optind]) env_set(argv[optind], NULL, opts.place);
|
||||
return exit_res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user