C shell bug
utzoo!decvax!cca!hplabs!menlo70!hao!pag at sri-unix
utzoo!decvax!cca!hplabs!menlo70!hao!pag at sri-unix
Wed May 5 13:48:57 AEST 1982
There is a bug in all versions of the C shell that I have tested.
It concerns the spacing of nested "if" statements when the outer
"if" condition is false. The following will demonstrate the problem:
if (0 == 1) then
if(a == b) then
echo hello
endif
echo This should not be executed.
endif
Note that there is no space after the 2nd "if".
When executed the "This should not be executed" prints. This happens
because the "endif" of the interior "if" is matched to the first "if".
If the 2nd line is replaced with:
if (a == b) then #note spacing around conditional
everything works fine. I suspect, without having checked the source,
the parsing method used to find the matching "endif" to first condition
is at fault. If someone has already fixed this, let us know.
--peter gross
ucbvax!menlo70!hao!pag
More information about the Comp.bugs.2bsd
mailing list