Don't segfault when dir is empty

This commit is contained in:
fredb
2007-01-16 21:34:18 +00:00
parent 63730a6e2c
commit 40aecd688e

View File

@@ -195,6 +195,8 @@ bool SGPath::exists() const {
void SGPath::create_dir( mode_t mode ) {
string_list dirlist = sgPathSplit(dir());
if ( dirlist.empty() )
return;
string path = dirlist[0];
string_list path_elements = sgPathBranchSplit(path);
bool absolute = !path.empty() && path[0] == sgDirPathSep;