changeset 685:18b7c2c9f838

Oops, fix previous commit.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Mar 2020 00:12:16 +0200
parents a6e7a29ecd30
children dfc2c9f0577f
files th_file.c
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/th_file.c	Wed Mar 04 23:39:11 2020 +0200
+++ b/th_file.c	Thu Mar 05 00:12:16 2020 +0200
@@ -160,10 +160,6 @@
     size_t start = 0, end;
     BOOL res = FALSE;
 
-    // If mode is 0, default to something sensible
-    if (mode == 0)
-        mode = 0711;
-
     // Start creating the directory stucture
     do
     {
@@ -190,7 +186,7 @@
                 if (!CreateDirectory(path, NULL))
                     goto error;
 #else
-                if (mkdir(path, mode) < 0)
+                if (mkdir(path, mode != 0 ? mode : 0711) < 0)
                     goto error;
 #endif
             }