Previously, ksh could skip setting the exit code from the last command of a function. As a result, function could return wrong exit code. The code was updated to make sure exit code from the last command of a function is used and functions now return correct exit code.
Description of problem:
Under some circumstances, one gets an incorrect return code from a function.
Version-Release number of selected component (if applicable):
ksh-20120801-10.el6_5.6.x86_64
How reproducible:
always
Steps to Reproduce:
1. run the reproducer (see the attachment)
Actual results:
Res is: 0
Res is: 1
Expected results:
Res is: 1
Res is: 1
Additional info:
N/A
Created attachment 914813[details]
reproducer
Please, note that function foo() is affected by the bug while the return code of function bar() is correct.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2014-1381.html