Scan deps tool crashes when called on a C++ file, containing an include
that has the same name as a directory. For example:
test.cpp:
#include <dir>
int main() { return 0; }
In directory foo/ :
dir/ bar/dir(file)
Now if the compile command is:
clang++ -I foo/ -I foo/bar/ -c test.cpp
The tool crashes since it finds foo/dir and tries to read that as a file and fails.
In this change, I add a defence against that scenario in the Dependency Scanning
File system.