Add the subdir to the path before trying to create it, instead of afterwards.

This commit is contained in:
ehofman
2005-12-17 15:41:48 +00:00
parent 0911fa4fa2
commit 4c68d03457

View File

@@ -196,7 +196,7 @@ void SGPath::create_dir( mode_t mode ) {
dir.add(dirlist[i]);
}
for(;i < dirlist.size(); i++) {
string subdir = dirlist[i];
dir.add(dirlist[i]);
#ifdef _MSC_VER
if ( _mkdir( subdir.c_str()) ) {
#else
@@ -205,7 +205,6 @@ void SGPath::create_dir( mode_t mode ) {
SG_LOG( SG_IO, SG_ALERT, "Error creating directory: " + dir.str() );
break;
}
dir.add(subdir);
}
}