Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Re: Odd trap return status



On Wed, 29 May 2002, Peter Stephenson wrote:

> I think you may be missing the point a bit, unless I am...
>
>   trap 'return 1' DEBUG
>
> would already cause a return from the enclosing function, only the
> return status would get lost.  I haven't changed the command flow

Right, but

	foo () {
	 trap 'false' DEBUG
	 true
	}

should not cause the exit status of foo to be nonzero.  Really the worse
case is

	foo() {
	 trap 'echo This command succeeds' DEBUG
	 false
	}

which should not cause foo() to return a zero status.  Installing a debug
trap shouldn't change the behavior of the debugged code unless it *also*
(intentionally) changes the command flow.



Messages sorted by: Reverse Date, Date, Thread, Author