commit 44a05f8

Devine Lu Linvega  ·  2025-03-14 17:50:01 +0000 UTC
parent fd7aa71
Removed win32 header
1 files changed,  +4, -11
+4, -11
 1@@ -5,18 +5,11 @@
 2 #include <unistd.h>
 3 #include <string.h>
 4 
 5-#ifdef _WIN32
 6-#include <direct.h>
 7-#define DIRCHAR '\\'
 8-#define mkdir(file_name) (_mkdir(file_name) == 0)
 9-#else
10-#define DIRCHAR '/'
11-#define mkdir(file_name) (mkdir(file_name, 0755) == 0)
12-#endif
13-
14 #include "../uxn.h"
15 #include "file.h"
16 
17+#define DIRCHAR '/'
18+
19 /*
20 Copyright (c) 2021-2025 Devine Lu Linvega, Andrew Alderwick
21 
22@@ -46,7 +39,7 @@ static Uint8 dirbuf[0x10000], *_dirbuf = dirbuf;
23 static void
24 make_pathfile(char *pathbuf, const char *filepath, const char *basename)
25 {
26-	char c = '/';
27+	char c = DIRCHAR;
28 	while(*filepath)
29 		c = *filepath++, *pathbuf = c, pathbuf++;
30 	if(c != DIRCHAR)
31@@ -151,7 +144,7 @@ file_write_dir(char *p)
32 	for(; ok && (c = *p); p++) {
33 		if(c == DIRCHAR) {
34 			*p = '\0';
35-			ok = is_dir_real(s) || mkdir(s);
36+			ok = is_dir_real(s) || (mkdir(s, 0755) == 0);
37 			*p = c;
38 		}
39 	}