added path_getUserDir, dir_createParent

This commit is contained in:
2025-12-21 20:00:10 +05:00
parent 7dc80c2fdf
commit 26de01c3e7
7 changed files with 66 additions and 13 deletions

View File

@@ -2,11 +2,10 @@
#include "tlibc/string/StringBuilder.h"
str str_copy(const str self){
if(self.data == NULL || self.len == 0)
return self;
str copy = str_construct((char*)malloc(self.len + 1), self.len, true);
memcpy(copy.data, self.data, self.len);
if(self.len != 0){
memcpy(copy.data, self.data, self.len);
}
copy.data[copy.len] = '\0';
return copy;
}