diff options
| author | Dragos <dragos.andreip@yahoo.com> | 2022-12-26 19:21:24 +0200 |
|---|---|---|
| committer | Dragos <dragos.andreip@yahoo.com> | 2022-12-26 19:21:24 +0200 |
| commit | 465d003b1e70bd4a8cb6623bb71968b79ff66193 (patch) | |
| tree | 6dd7638ce45db959502b55fc26f70ea485d39e89 /src/path.cpp | |
| parent | 0829ac30f743aa567b2da5dc490ff1b2b13ea37c (diff) | |
Patched empty output_path.name when building a folder
Diffstat (limited to 'src/path.cpp')
| -rw-r--r-- | src/path.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/path.cpp b/src/path.cpp index 6f83c39ea..dbc913e61 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -107,7 +107,9 @@ String path_to_string(gbAllocator a, Path path) { isize i = 0;
gb_memmove(str+i, path.basename.text, path.basename.len); i += path.basename.len;
+
gb_memmove(str+i, "/", 1); i += 1;
+
gb_memmove(str+i, path.name.text, path.name.len); i += path.name.len;
if (path.ext.len > 0) {
gb_memmove(str+i, ".", 1); i += 1;
@@ -150,6 +152,7 @@ Path path_from_string(gbAllocator a, String const &path) { return res;
}
+ // Note(Dragos): Is the copy_string required if it's a substring?
isize name_start = (res.basename.len > 0) ? res.basename.len + 1 : res.basename.len;
res.name = substring(fullpath, name_start, fullpath.len);
res.name = remove_extension_from_path(res.name);
|