Text File

Ahao.235 net.bugs.2bsd,net.bugs.4bsd utzoo!decvax!cca!hplabs!menlo70!hao!pag@sri-unix Wed May 5 13:48:57 1982 C shell bug 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

----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen <jgoerzen@complete.org> of http://communication.ucsd.edu/A-News/

This Usenet Oldnews Archive article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.