mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 09:05:10 +00:00
Fix #487 dead loop in hierarchical .cquery
This commit is contained in:
parent
68b7ed5852
commit
df95cd4780
@ -333,8 +333,12 @@ std::vector<Project::Entry> LoadFromDirectoryListing(Config* init_opts,
|
|||||||
|
|
||||||
auto GetCompilerArgumentForFile = [&config,
|
auto GetCompilerArgumentForFile = [&config,
|
||||||
&folder_args](const std::string& path) {
|
&folder_args](const std::string& path) {
|
||||||
for (std::string cur = GetDirName(path);
|
for (std::string cur = GetDirName(path); ; cur = GetDirName(cur)) {
|
||||||
NormalizePath(cur) != config->project_dir; cur = GetDirName(cur)) {
|
std::string normalized = NormalizePath(cur);
|
||||||
|
if (normalized.size() <= config->project_dir.size() ||
|
||||||
|
normalized.compare(0, config->project_dir.size(),
|
||||||
|
config->project_dir) != 0)
|
||||||
|
break;
|
||||||
auto it = folder_args.find(cur);
|
auto it = folder_args.find(cur);
|
||||||
if (it != folder_args.end()) {
|
if (it != folder_args.end()) {
|
||||||
return it->second;
|
return it->second;
|
||||||
|
Loading…
Reference in New Issue
Block a user