added path_getUserDir, dir_createParent
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user