From dc517212caf3a8263cea9587bc6e96f7ff129b59 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 5 Oct 2016 12:14:43 +0100 Subject: 39566: Improve usefulness of command_not_found_handler. Don't behave as if command not found if return status is non-zero as this may simply be the return status of the replacement command. Let the function report a command not found instead. --- Test/C04funcdef.ztst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Test') diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst index 9f15e04ff..ab7b42928 100644 --- a/Test/C04funcdef.ztst +++ b/Test/C04funcdef.ztst @@ -120,14 +120,13 @@ print "Your command:" >&2 print "$1" >&2 print "has gone down the tubes. Sorry." >&2 - return 1 + return 42 } ThisCommandDoesNotExistEither -127:Command not found handler, failure +42:Command not found handler, failure ?Your command: ?ThisCommandDoesNotExistEither ?has gone down the tubes. Sorry. -?(eval):7: command not found: ThisCommandDoesNotExistEither local variable=outside print "I am $variable" -- cgit 1.4.1