Article View: net.bugs
Article #22Ctags bug
From: ucf-cswhm
Date: Tue, 13 Apr 1982 15:27
Date: Tue, 13 Apr 1982 15:27
29 lines
1122 bytes
1122 bytes
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
Technical Details
Message-ID:
<anews.Aucf-cs.511>Path:
arc1-ca.pugleaf.net!utzoo!decvax!duke!ucf-cs!whmShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!decvax!duke!ucf-cs!whm From: ucf-cs!whm Newsgroups: net.bugs Subject: Ctags bug Date: Tue, 13 Apr 1982 15:27:08 +0000 Message-ID: <anews.Aucf-cs.511>