Fix directory creation: 'ds' remains the same while 'dir' gets updated so use 'dir' instead
This commit is contained in:
parent
372dead21a
commit
f4344c5c6a
@ -579,14 +579,15 @@ int SGPath::create_dir(mode_t mode)
|
||||
#endif
|
||||
struct stat info;
|
||||
int r;
|
||||
for(; (r = stat(ds.c_str(), &info)) == 0 && i < path_elements.size(); ++i)
|
||||
for(; (r = stat(dir.c_str(), &info)) == 0 && i < path_elements.size(); ++i) {
|
||||
dir.append(path_elements[i]);
|
||||
}
|
||||
if( r == 0 )
|
||||
return 0; // Directory already exists
|
||||
|
||||
for(;;)
|
||||
{
|
||||
if( sgMkDir(ds.c_str(), mode) )
|
||||
if( sgMkDir(dir.c_str(), mode) )
|
||||
{
|
||||
SG_LOG( SG_IO,
|
||||
SG_ALERT, "Error creating directory: (" << dir << ")" );
|
||||
|
Loading…
Reference in New Issue
Block a user