mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Fix bug in return and block builtins - they where unable to handle functions that do not shadow the calling scope
darcs-hash:20080109030136-75c98-05f7a48cd991ac24e15d7e8b580caef0396ff59c.gz
This commit is contained in:
parent
8e9384e2e8
commit
2229fad410
2 changed files with 7 additions and 4 deletions
10
builtin.c
10
builtin.c
|
@ -866,7 +866,9 @@ static int builtin_block( wchar_t **argv )
|
|||
}
|
||||
case UNSET:
|
||||
{
|
||||
while( block && block->type != FUNCTION_CALL )
|
||||
while( block &&
|
||||
block->type != FUNCTION_CALL &&
|
||||
block->type != FUNCTION_CALL_NO_SHADOW )
|
||||
block = block->outer;
|
||||
}
|
||||
}
|
||||
|
@ -3458,7 +3460,8 @@ static int builtin_return( wchar_t **argv )
|
|||
|
||||
|
||||
while( (b != 0) &&
|
||||
( b->type != FUNCTION_CALL) )
|
||||
( b->type != FUNCTION_CALL &&
|
||||
b->type != FUNCTION_CALL_NO_SHADOW) )
|
||||
{
|
||||
b = b->outer;
|
||||
}
|
||||
|
@ -3473,7 +3476,8 @@ static int builtin_return( wchar_t **argv )
|
|||
}
|
||||
|
||||
b = current_block;
|
||||
while( ( b->type != FUNCTION_CALL))
|
||||
while( ( b->type != FUNCTION_CALL &&
|
||||
b->type != FUNCTION_CALL_NO_SHADOW ) )
|
||||
{
|
||||
b->type = FAKE;
|
||||
b->skip=1;
|
||||
|
|
|
@ -1417,7 +1417,6 @@ g++, javac, java, gcj, lpr, doxygen, whois)
|
|||
- delete-word is broken on the commandline 'sudo update-alternatives --config x-'
|
||||
- Sometimes autoheader needs to be run on a fresh tarball. Fix dates before creating tarballs.
|
||||
- The completion autoloader does not remember which completions where actually autoloaded, and may unload manually specified completions.
|
||||
- Calling return in functions with no scope shadowing triggers a bug
|
||||
|
||||
If you think you have found a bug not described here, please send a
|
||||
report to <a href="mailto:fish-users@lists.sf.net">fish-users@lists.sf.net</a>.
|
||||
|
|
Loading…
Reference in a new issue