]> git.mxchange.org Git - simgear.git/commitdiff
Olaf Flebbe: Avoid infinite recursion in simgear::Dir::create
authorThorstenB <brehmt@gmail.com>
Fri, 10 Feb 2012 21:36:24 +0000 (22:36 +0100)
committerThorstenB <brehmt@gmail.com>
Fri, 10 Feb 2012 21:42:27 +0000 (22:42 +0100)
when using it with a relative path.

simgear/misc/sg_dir.cxx

index 8922b030e0d038ca506a46c85b094532f6173284..1514c9501a38497cd7a1080e078fc5ea2110753b 100644 (file)
@@ -265,7 +265,7 @@ bool Dir::create(mode_t mode)
     
 // recursively create parent directories
     Dir pr(parent());
-    if (!pr.exists()) {
+    if (!pr.path().isNull() && !pr.exists()) {
         bool ok = pr.create(mode);
         if (!ok) {
             return false;