string and StringBuilder

This commit is contained in:
2023-06-08 18:34:42 +06:00
parent 32ce7d3a70
commit 8d36fd8042
21 changed files with 186 additions and 109 deletions

View File

@@ -52,7 +52,8 @@ Maybe path_throwIfEscapes(const char* path){
LinearAllocator _al; LinearAllocator_construct(&_al, 128);
allocator_ptr al=&_al.base;
if(cptr_contains(path,".."))
safethrow(cptr_concat(al, "path <",path,"> uses <..>, that's not allowed"),);
safethrow(cptr_concat(al, "path <",path,"> uses <..>, that's not allowed"),
LinearAllocator_destruct(&_al));
LinearAllocator_destruct(&_al);
return MaybeNull;
}
@@ -83,5 +84,5 @@ char* path_basename(allocator_ptr al, char* path, bool with_extension){
if(extIndex!=0 && extIndex!=-1)
rezult.length=extIndex;
}
return string_extract(rezult);
return string_extract(al, rezult);
}