From 2229fad41025c32d6c79c9ce141c0ef4456fdae4 Mon Sep 17 00:00:00 2001 From: liljencrantz Date: Wed, 9 Jan 2008 13:01:36 +1000 Subject: [PATCH] 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 --- builtin.c | 10 +++++++--- doc_src/index.hdr.in | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/builtin.c b/builtin.c index 6bd5445d1..9bf3bd6b6 100644 --- a/builtin.c +++ b/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; diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in index 4b502fb99..b02a6dded 100644 --- a/doc_src/index.hdr.in +++ b/doc_src/index.hdr.in @@ -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 fish-users@lists.sf.net.