mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
Avoid check mistakenly current folder for .git/.svn/.CVS, when going up the path checking for parents.
This commit is contained in:
parent
ceb2303e2b
commit
34dfe2d71e
@ -102,17 +102,15 @@ bool VCS::makeRCSRevision(string const &version, string &revis) const
|
||||
bool VCS::checkparentdirs(FileName const & file, std::string const & pathname)
|
||||
{
|
||||
FileName dirname = file.onlyPath();
|
||||
do {
|
||||
FileName tocheck = FileName(addName(dirname.absFileName(), pathname));
|
||||
LYXERR(Debug::LYXVC, "check file: " << tocheck.absFileName());
|
||||
bool result = tocheck.exists();
|
||||
while ( !result && !dirname.empty() ) {
|
||||
if (tocheck.exists())
|
||||
return true;
|
||||
//this construct because of #8295
|
||||
dirname = FileName(dirname.absFileName()).parentPath();
|
||||
LYXERR(Debug::LYXVC, "check directory: " << dirname.absFileName());
|
||||
tocheck = FileName(addName(dirname.absFileName(),pathname));
|
||||
result = tocheck.exists();
|
||||
}
|
||||
return result;
|
||||
} while (!dirname.empty());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user