1201 icg nocomment file and dir (#1202)

* #1201 make icg_nocomment variable work with files as well as dirs

closes #1201
This commit is contained in:
Scott Fennell 2021-11-16 19:03:35 -06:00 committed by GitHub
parent 4b2dc2f8ec
commit 1315db14a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -302,29 +302,22 @@ bool HeaderSearchDirs::isPathInExtLib (const std::string& in_dir ) {
return false ;
}
bool HeaderSearchDirs::isPathInICGNoComment (const std::string& in_file ) {
char * resolved_path = almostRealPath(in_file.c_str() ) ;
if ( resolved_path != NULL ) {
std::string dir = std::string(dirname(resolved_path)) + "/";
if ( icg_nocomment_files.find(dir) == icg_nocomment_files.end() ) {
icg_nocomment_files[dir] = false ;
bool HeaderSearchDirs::isPathInICGNoComment (const std::string& in_dir ) {
if ( icg_nocomment_files.find(in_dir) != icg_nocomment_files.end() ) {
return icg_nocomment_files[in_dir] ;
}
else {
std::vector<std::string>::iterator vit ;
for ( vit = icg_nocomment_dirs.begin() ; vit != icg_nocomment_dirs.end() ; vit++ ) {
if ( ! dir.compare(0, (*vit).size(), (*vit))) {
icg_nocomment_files[dir] = true ;
break ;
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
icg_nocomment_files[in_dir] = true ;
return true;
}
}
}
free(resolved_path) ;
return icg_nocomment_files[dir] ;
}
icg_nocomment_files[in_dir] = false ;
return false;
}
}
bool HeaderSearchDirs::isPathInCompat15 (const std::string& in_dir ) {