mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
parent
4ff8e6e781
commit
02f18cae0a
3 changed files with 12 additions and 2 deletions
|
@ -3375,7 +3375,7 @@ static int builtin_source(parser_t &parser, io_streams_t &streams, wchar_t **arg
|
|||
parser.push_block(new source_block_t(fn_intern));
|
||||
reader_push_current_filename(fn_intern);
|
||||
|
||||
env_set_argv((argc>2)?(argv+2):(argv+1));
|
||||
env_set_argv(argc > 1 ? argv + 2 : argv + 1);
|
||||
|
||||
res = reader_read(fd, streams.io_chain ? *streams.io_chain : io_chain_t());
|
||||
|
||||
|
|
|
@ -166,5 +166,11 @@ function always_fails
|
|||
end
|
||||
end
|
||||
|
||||
always_fails ; echo $status
|
||||
# Verify $argv set correctly in sourced scripts.
|
||||
# Issue #139
|
||||
echo 'echo "source argv {$argv}"' | source
|
||||
echo 'echo "source argv {$argv}"' | source -
|
||||
echo 'echo "source argv {$argv}"' | source - abc
|
||||
echo 'echo "source argv {$argv}"' | source - abc def
|
||||
|
||||
always_fails ; echo $status
|
||||
|
|
|
@ -52,4 +52,8 @@ pipe 11
|
|||
pipe 12
|
||||
Checking for infinite loops in no-execute
|
||||
before comment after comment
|
||||
source argv {}
|
||||
source argv {}
|
||||
source argv {abc}
|
||||
source argv {abc def}
|
||||
1
|
||||
|
|
Loading…
Reference in a new issue