Ctags bug

utzoo!decvax!duke!ucf-cs!whm utzoo!decvax!duke!ucf-cs!whm
Tue Apr 13 15:27:08 AEST 1982


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



More information about the Net.bugs mailing list