summary refs log tree commit diff
path: root/src/mkbuiltins
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2020-01-19 18:21:59 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2020-04-29 16:04:17 +1000
commitf613f9573f044220453069ee81ed8706c6e18225 (patch)
tree89c0248f36c673e01909222f9f79718d054eee9b /src/mkbuiltins
parentshell: delete AC_PROG_YACC (diff)
downloaddash-f613f9573f044220453069ee81ed8706c6e18225.tar.gz
dash-f613f9573f044220453069ee81ed8706c6e18225.zip
redir: Clear saved redirections in subshell
When we enter a subshell we need to drop the saved redirections
as otherwise a subsequent unwindredir could produce incorrect
results.

This patch does this by simply clearing redirlist.  While we
could actually free the memory underneath for subshells it isn't
really worth the trouble for now.

In order to ensure that this is done in every place where we enter
a subshell, this patch adds a new mkinit hook called forkreset.
The calls closescript, clear_traps and reset_handler are also added
to the forkreset hook.

This fixes a bug where the first two functions weren't called
if we enter a subshell without forking.

Reported-by: Harald van Dijk <harald@gigawatt.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
ae700a2ba82ef2282ddc5404d8de8646cd57&follow=1'>Replace __dead2 with __attribute__((noreturn))June McEnroe sed 's/__dead2/__attribute__((noreturn))/' 2020-06-08Replace __FBSDID macros with commentsJune McEnroe sed -E 's|__FBSDID[(]"([^"]+)"[)];|/* \1 */|' 2020-06-08Remove reference to FreeBSD-specific libedit hackJune McEnroe Newer versions of libedit have sane tab-complete now without FreeBSD's hacks, and in fact the hack is gone in FreeBSD-CURRENT. I'm still a little confused why binding this weird function is necessary at all, but at least it exists everywhere, I guess. 2020-06-08Prefix mandoc with exec in about-filterJune McEnroe 2020-06-07Remove mktemp options from mkbuiltins, mktokensJune McEnroe Why even? 2020-06-07Cast z_stream fields to size_tJune McEnroe In the version of zlib in OpenBSD, these fields are of type off_t, which is signed (why?), rather than uLong. 2020-06-07Call static_assert by _Static_assertJune McEnroe OpenBSD doesn't #define static_assert in assert.h and _Static_assert is its real name I guess so why not? 2020-06-07Add OpenBSD to install.shJune McEnroe Straightforward. 2020-06-03Add The Song of AchillesJune McEnroe 2020-06-01Allow redirecting input in everJune McEnroe 2020-05-31Add %c conversion to c scriptJune McEnroe 2020-05-31Add c script to READMEJune McEnroe 2020-05-31Add c scriptJune McEnroe 2020-05-31Update mdoc source URLsJune McEnroe 2020-05-26Remove unfinished PSF fontsJune McEnroe