]> git.mxchange.org Git - simgear.git/commitdiff
Add the subdir to the path before trying to create it, instead of afterwards.
authorehofman <ehofman>
Sat, 17 Dec 2005 15:41:48 +0000 (15:41 +0000)
committerehofman <ehofman>
Sat, 17 Dec 2005 15:41:48 +0000 (15:41 +0000)
simgear/misc/sg_path.cxx

index 056a84db1a1857f4727508ecd96035107a923926..3ae10a73c2bab23de4a235668f4ce2905a41787c 100644 (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);
     }
 }