Aucf-cs.511
net.bugs
utzoo!decvax!duke!ucf-cs!whm
Tue Apr 13 15:27:08 1982
Ctags bug
The version of ctags that we have that came with 4.1bsd has an apparent
bug at line 191. The section is as follows:
curfile = savestr(file);
cp = rindex(file, '.');
191-> if (cp && (cp[1] != 'c' || cp[1] != 'h') && cp[2] == 0) {
if (PF_funcs(inf) == 0) {
rewind(inf);
C_funcs();
}
} else
C_funcs();
Which appears to look for Pascal Functions if the file name doesn't
end in a .h or a .c. However, the conditional is incorrect, the line
should read:
if (cp && cp[1] != 'c' && cp[1] != 'h' && cp[2] == 0) {
If || is used, the conditional will always be true, it's like saying:
if (x != 1 || x != 2) ....
which is usually always true on most computers based on current techonology.
This bug may have been reported before, I think I remember seeing a mention
of a ctags bug a couple of months back, but I'm too lazy to look through
the old news for it.
Bill Mitchell
Univ. of Central Florida
-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <
[email protected]>
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.