mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +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,20 +102,18 @@ bool VCS::makeRCSRevision(string const &version, string &revis) const
|
||||
bool VCS::checkparentdirs(FileName const & file, std::string const & pathname)
|
||||
{
|
||||
FileName dirname = file.onlyPath();
|
||||
FileName tocheck = FileName(addName(dirname.absFileName(),pathname));
|
||||
LYXERR(Debug::LYXVC, "check file: " << tocheck.absFileName());
|
||||
bool result = tocheck.exists();
|
||||
while ( !result && !dirname.empty() ) {
|
||||
do {
|
||||
FileName tocheck = FileName(addName(dirname.absFileName(), pathname));
|
||||
LYXERR(Debug::LYXVC, "check file: " << tocheck.absFileName());
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// RCS
|
||||
|
Loading…
Reference in New Issue
Block a user