realpath'ize all source mount points. closes #117

This commit is contained in:
Antonio SJ Musumeci
2015-09-06 18:24:36 -04:00
parent 2d899479c3
commit ce9352987c
4 changed files with 24 additions and 0 deletions
+18
View File
@@ -29,6 +29,8 @@
#include <cstdlib>
#include <iterator>
#include <stdlib.h>
#include <limits.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
@@ -510,4 +512,20 @@ namespace fs
globfree(&gbuf);
}
void
realpathize(vector<string> &strs)
{
char *rv;
char buf[PATH_MAX];
for(size_t i = 0; i < strs.size(); i++)
{
rv = ::realpath(strs[i].c_str(),buf);
if(rv == NULL)
continue;
strs[i] = buf;
}
}
};