incfile() adds a directory to srcfiles[] causing an annoying error during scanning.
This happens when there is an include directory with a matching name of an "#include":
~/target/usr/include/dir/dir.h
and a C++ file like this:
...
#include <dir>
...
Patch looks good.
But just in case, please note that even with the patch, cscope would not find that header
dir.h
while looking for<dir>
Thanks. Understood about not opening the
dir.h
BTW would it be sensible to move the checking for regular files into the addsrcfile()?
No, that wouldn't be truly sensible. addsrcfile() has a well-defined job, as given by its name: add something to
srcfiles
. Doing more in there would be somewhat wastefule, e.g. in the cases where it's called on reading the current database, i.e. with pathnames that have already been vetted the previous time round.Got it!