From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id b37498b0 for ; Tue, 17 Dec 2019 07:45:41 +0000 (UTC) Received: (qmail 13453 invoked by alias); 17 Dec 2019 07:45:08 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45066 Received: (qmail 18889 invoked by uid 1010); 17 Dec 2019 07:45:07 -0000 X-Qmail-Scanner-Diagnostics: from wout4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25663. spamassassin: 3.4.2. Clear:RC:0(64.147.123.20):SA:0(-1.9/5.0):. Processed in 0.280656 secs); 17 Dec 2019 07:45:07 -0000 X-Envelope-From: danielsh@apache.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: softfail (ns1.primenet.com.au: transitioning SPF record at amazonses.com does not designate 64.147.123.20 as permitted sender) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddtiedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogfggedutddqvdejucdlgedtmdenucfjughrpe fhvffufffkofgjfhestddtredtredttdenucfhrhhomhepffgrnhhivghlucfuhhgrhhgr fhcuoegurghnihgvlhhshhesrghprggthhgvrdhorhhgqeenucfkphepjeelrddukedtrd ehjedrudduleenucfrrghrrghmpehmrghilhhfrhhomhepuggrnhhivghlshhhsegrphgr tghhvgdrohhrghenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH 3/3] internal: Document forklevel, locallevel, and exit_pending. Date: Tue, 17 Dec 2019 07:44:28 +0000 Message-Id: <20191217074428.3699-3-danielsh@apache.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191217074428.3699-1-danielsh@apache.org> References: <20191217074428.3699-1-danielsh@apache.org> --- Src/builtin.c | 6 +++++- Src/exec.c | 4 ++++ Src/params.c | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Src/builtin.c b/Src/builtin.c index 5fe5ea6d1..0ecabf854 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -5601,7 +5601,11 @@ bin_getopts(UNUSED(char *name), char **argv, UNUSED(Options ops), UNUSED(int fun return 0; } -/* Flag that we should exit the shell as soon as all functions return. */ +/* Boolean flag that we should exit the shell as soon as all functions return. + * + * Set by the 'exit' builtin. + */ + /**/ mod_export int exit_pending; diff --git a/Src/exec.c b/Src/exec.c index 0d9d7de7c..50027654a 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -971,6 +971,10 @@ hashcmd(char *arg0, char **pp) return cn; } +/* The value that 'locallevel' had when we forked. When we get back to this + * level, the current process (which is a subshell) will terminate. + */ + /**/ int forklevel; diff --git a/Src/params.c b/Src/params.c index da7a6b4c5..5eaafe34e 100644 --- a/Src/params.c +++ b/Src/params.c @@ -44,7 +44,11 @@ #endif #endif -/* what level of localness we are at */ +/* What level of localness we are at. + * + * Hand-wavingly, this is incremented at every function call and decremented + * at every function return. See startparamscope(). + */ /**/ mod_export int locallevel;