We just upgraded our application from tru64 4.0g to tru64 5.1 and we encountered a strange behaviour in one of the shell scripts

Shell script works in two different ways in T4.0g and T5.1.
Note: We use ksh.

Problem can be illustrated using three shell scripts : first.ksh, second.ksh and third.ksh.
first.ksh is the parent shell program.


first.ksh
---------

function1()
{
. second.ksh
}

echo "calling function1"
f = function1
eval $f
echo "end of first shell"


second.ksh
-------------

. third.ksh

echo "i am in second shell script"
endfunction

third.ksh
----------
endfunction()
{
exit
}

If I run first.ksh in tru64 4.0g, I get the output as
calling function1
i am in second shell script
end of first shell

But, if I run first.ksh in tru64 5.1, i get the output as
calling function1
i am in second shell script

That is, in T5.1, after executing second.ksh, it comes out of current shell whereas in T4.0g, it does not. Logically speaking, it should work as in T5.1 since, second.ksh also executes in the same shell as of first.ksh and hence exit should completely terminate.

Does this mean that T4.0g had a bug? Was there any similar problem reported? Or Am I missing any setting anywhere Or is it something else?

Thanks in advance for any kind of reply... Faster replies appreciated.

Thanks and regards
Sandhya