From 2e5821c17df189a8885b4a3bfb81e7192ee9d1a3 Mon Sep 17 00:00:00 2001 From: axel Date: Tue, 13 Jun 2006 02:51:37 +1000 Subject: [PATCH] Do not change status when the 'exit' builtin is called with no argument darcs-hash:20060612165137-ac50b-0281941e35c5f8b619460f67d24a89caec475815.gz --- builtin.c | 1 + doc_src/exit.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin.c b/builtin.c index 41d460f5a..e896ac916 100644 --- a/builtin.c +++ b/builtin.c @@ -1903,6 +1903,7 @@ static int builtin_exit( wchar_t **argv ) { case 1: { + ec = proc_get_last_status(); break; } diff --git a/doc_src/exit.txt b/doc_src/exit.txt index b71f7b0db..aa96fe95c 100644 --- a/doc_src/exit.txt +++ b/doc_src/exit.txt @@ -7,7 +7,7 @@ The exit builtin causes fish to exit. If STATUS is supplied, it will be converted to an integer and used as the exit -code. Otherwise the exit code will be 0. +code. Otherwise the exit code will be that of the last command executed. If exit is called while sourcing a file (using the . builtin) the rest of the file will be skipped,