Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/bin/sh



Module Name:    src
Committed By:   kre
Date:           Mon Dec  3 06:43:19 UTC 2018

Modified Files:
        src/bin/sh: eval.c eval.h main.c sh.1 trap.c trap.h

Log Message:
Cleanup traps a bit - attempt to handle weird uses in traps, such
as traps that issue break/continue/return to cause the loop/function
executing when the trap occurred to break/continue/return, and
generating the correct exit code from the shell including when a
signal is caught, but the trap handler for it exits.

All that from FreeBSD.

Also make
        T=$(trap)
work as it is supposed to (also trap -p).

For now this is handled by the same technique as $(jobs) - rather
than clearing the traps in subshells, just mark them invalid, and
then whenever they're invalid, clear them before executing anything
other than the special blessed "trap" command.   Eventually we will
handle these using non-subshell command substitution instead (not
creating a subshell environ when the commands in a command-sub alter
nothing in the environment).


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/bin/sh/eval.c
cvs rdiff -u -r1.21 -r1.22 src/bin/sh/eval.h
cvs rdiff -u -r1.77 -r1.78 src/bin/sh/main.c
cvs rdiff -u -r1.209 -r1.210 src/bin/sh/sh.1
cvs rdiff -u -r1.46 -r1.47 src/bin/sh/trap.c
cvs rdiff -u -r1.23 -r1.24 src/bin/sh/trap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index