aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-07-13 03:31:41 +1000
committerGravatar axel <axel@liljencrantz.se>2006-07-13 03:31:41 +1000
commit036cc4e0faccc9b03e2c73b34dd4ad6a0223837b (patch)
treee741110f01581d649e7062381763fb396985549a
parent9e304fa7340b8b74a604564cb44e426cafbe7d34 (diff)
The begin builtin should not alter the exit status
darcs-hash:20060712173141-ac50b-8d21f9f22ef55581521ccf923411e3458bd8109c.gz
-rw-r--r--builtin.c2
-rw-r--r--doc_src/begin.txt2
-rw-r--r--doc_src/end.txt2
3 files changed, 4 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index e407c976..4b30dce0 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2476,7 +2476,7 @@ static int builtin_begin( wchar_t **argv )
{
parser_push_block( BEGIN );
current_block->tok_pos = parser_get_pos();
- return 0;
+ return proc_get_last_status();
}
diff --git a/doc_src/begin.txt b/doc_src/begin.txt
index b955376d..07ef10e0 100644
--- a/doc_src/begin.txt
+++ b/doc_src/begin.txt
@@ -13,6 +13,8 @@ into a block. The reason for this is usually either to introduce a new
variable scope or to redirect the input to output of this set of
commands as a group.
+The \c begin command does not change the current exit status.
+
\subsection begin-example Example
The following code sets a number of variables inside of a block
diff --git a/doc_src/end.txt b/doc_src/end.txt
index b98aef82..3b61e9d3 100644
--- a/doc_src/end.txt
+++ b/doc_src/end.txt
@@ -13,4 +13,4 @@ begin; [COMMANDS...] end
documentation for the block constructs, such as \c if, \c for and \
while.
-The end command does not change the current exit status.
+The \c end command does not change the current exit status.