summaryrefslogtreecommitdiffstats
path: root/tools/atree
diff options
context:
space:
mode:
authorJey <jey.michael@gmail.com>2008-12-10 09:07:28 -0800
committerJean-Baptiste Queru <jbq@google.com>2009-11-08 13:19:45 -0800
commit9af5fc4e447863f0961bc60c1cf252c88f1088c2 (patch)
treea2ff7a43c6ddec7a53e9c2af12e0ddf0b5089d43 /tools/atree
parentceb18f8923ca85203094b2b0702f5d81c0622c46 (diff)
downloadbuild-9af5fc4e447863f0961bc60c1cf252c88f1088c2.zip
build-9af5fc4e447863f0961bc60c1cf252c88f1088c2.tar.gz
build-9af5fc4e447863f0961bc60c1cf252c88f1088c2.tar.bz2
Support absolute path, in OUT_DIR
Diffstat (limited to 'tools/atree')
-rw-r--r--tools/atree/fs.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/atree/fs.cpp b/tools/atree/fs.cpp
index 00f44c2..9971879 100644
--- a/tools/atree/fs.cpp
+++ b/tools/atree/fs.cpp
@@ -108,6 +108,10 @@ mkdir_recursively(const string& path)
{
int err;
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) {
pos = path.find('/', pos);
string p = path.substr(0, pos);