Support absolute path, in OUT_DIR

This commit is contained in:
Jey 2008-12-10 09:07:28 -08:00 committed by Jean-Baptiste Queru
parent ceb18f8923
commit 9af5fc4e44
1 changed files with 4 additions and 0 deletions

View File

@ -108,6 +108,10 @@ mkdir_recursively(const string& path)
{ {
int err; int err;
size_t pos = 0; size_t pos = 0;
// For absolute pathnames, that starts with leading '/'
// use appropriate initial value.
if (path.length() != 0 and path[0] == '/') pos++;
while (true) { while (true) {
pos = path.find('/', pos); pos = path.find('/', pos);
string p = path.substr(0, pos); string p = path.substr(0, pos);