diff options
| author | Bob Jamison <ishmalius@gmail.com> | 2006-11-18 02:06:29 +0000 |
|---|---|---|
| committer | ishmal <ishmal@users.sourceforge.net> | 2006-11-18 02:06:29 +0000 |
| commit | e790c266e1f3c7833b67351da4af2f0a60829b6d (patch) | |
| tree | 8f68f56b7c34791ed342ebd09814ba147f1483f2 /buildtool.cpp | |
| parent | Added regex. Greatly improved <fileset> scanning. (diff) | |
| download | inkscape-e790c266e1f3c7833b67351da4af2f0a60829b6d.tar.gz inkscape-e790c266e1f3c7833b67351da4af2f0a60829b6d.zip | |
Fixed absolute paths in createDirectory()
(bzr r1975)
Diffstat (limited to 'buildtool.cpp')
| -rw-r--r-- | buildtool.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/buildtool.cpp b/buildtool.cpp index 97c5a179d..eba0dc865 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -3903,7 +3903,7 @@ bool MakeBase::createDirectory(const String &dirname) struct stat finfo; String nativeDir = getNativePath(dirname); char *cnative = (char *) nativeDir.c_str(); - if (stat(dirname.c_str(), &finfo)==0) + if (stat(cnative, &finfo)==0) { if (!S_ISDIR(finfo.st_mode)) { @@ -3920,9 +3920,10 @@ bool MakeBase::createDirectory(const String &dirname) //## 2: pull off the last path segment, if any, //## to make the dir 'above' this one, if necessary unsigned int pos = dirname.find_last_of('/'); - if (pos != dirname.npos) + if (pos>0 && pos != dirname.npos) { String subpath = dirname.substr(0, pos); + //A letter root (c:) ? if (!createDirectory(subpath)) return false; } @@ -3930,7 +3931,7 @@ bool MakeBase::createDirectory(const String &dirname) //## 3: now make if (mkdir(cnative)<0) { - error("cannot make directory %s", cnative); + error("cannot make directory '%s'", cnative); return false; } @@ -6563,7 +6564,7 @@ public: error("<mkdir> requires 'dir=\"dirname\"' attribute"); return false; } - //trace("dirname:%s", dirName.c_str()); + trace("dirname:%s", dirName.c_str()); return true; } |
