From: ehofman Date: Sat, 17 Dec 2005 15:41:48 +0000 (+0000) Subject: Add the subdir to the path before trying to create it, instead of afterwards. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4c68d0345713a2c607afd8935b232fb48ec8f234;p=simgear.git Add the subdir to the path before trying to create it, instead of afterwards. --- diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx index 056a84db..3ae10a73 100644 --- a/simgear/misc/sg_path.cxx +++ b/simgear/misc/sg_path.cxx @@ -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); } }