| 174 | } |
| 175 | |
| 176 | static bool MkDirRecursiveInner(const std::string &Leaf) { |
| 177 | // Prevent chance of potential infinite recursion |
| 178 | if (Leaf == ".") |
| 179 | return true; |
| 180 | |
| 181 | const std::string &Dir = DirName(Leaf); |
| 182 | |
| 183 | if (IsDirectory(Dir)) { |
| 184 | MkDir(Leaf); |
| 185 | return IsDirectory(Leaf); |
| 186 | } |
| 187 | |
| 188 | bool ret = MkDirRecursiveInner(Dir); |
| 189 | if (!ret) { |
| 190 | // Give up early if a previous MkDir failed |
| 191 | return ret; |
| 192 | } |
| 193 | |
| 194 | MkDir(Leaf); |
| 195 | return IsDirectory(Leaf); |
| 196 | } |
| 197 | |
| 198 | bool MkDirRecursive(const std::string &Dir) { |
| 199 | if (Dir.empty()) |
no test coverage detected