Store original working directory before changing, for later turning user args into absolute paths

This commit is contained in:
Jean-Francois Dockes
2013-06-06 14:05:26 +02:00
parent 77cba9d0b3
commit e77c510dfe
5 changed files with 35 additions and 7 deletions
+4 -2
View File
@@ -157,9 +157,10 @@ bool ConfIndexer::index(bool resetbefore, ixType typestorun)
bool ConfIndexer::indexFiles(list<string>& ifiles, IxFlag flag)
{
list<string> myfiles;
string origcwd = m_config->getOrigCwd();
for (list<string>::const_iterator it = ifiles.begin();
it != ifiles.end(); it++) {
myfiles.push_back(path_canon(*it));
myfiles.push_back(path_canon(*it, &origcwd));
}
myfiles.sort();
@@ -239,9 +240,10 @@ bool ConfIndexer::updateDocs(std::vector<Rcl::Doc> &docs, IxFlag flag)
bool ConfIndexer::purgeFiles(std::list<string> &files)
{
list<string> myfiles;
string origcwd = m_config->getOrigCwd();
for (list<string>::const_iterator it = files.begin();
it != files.end(); it++) {
myfiles.push_back(path_canon(*it));
myfiles.push_back(path_canon(*it, &origcwd));
}
myfiles.sort();