Remove unused join_root_and_leaf
This commit is contained in:
parent
dbedcb3100
commit
4f5dd3900f
@ -9,8 +9,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void join_root_and_leaf(const char *root, const char *leaf, char *dst);
|
|
||||||
|
|
||||||
u32 wapp_cpath_join_path(Str8 *dst, const Str8List *parts) {
|
u32 wapp_cpath_join_path(Str8 *dst, const Str8List *parts) {
|
||||||
if (!dst || !parts) {
|
if (!dst || !parts) {
|
||||||
return CPATH_JOIN_INVALID_ARGS;
|
return CPATH_JOIN_INVALID_ARGS;
|
||||||
@ -133,23 +131,3 @@ LIST_CLEANUP_DIRUP:
|
|||||||
RETURN_DIRUP:
|
RETURN_DIRUP:
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
void join_root_and_leaf(const char *root, const char *leaf, char *dst) {
|
|
||||||
u64 root_length = strlen(root);
|
|
||||||
u64 leaf_length = strlen(leaf);
|
|
||||||
|
|
||||||
memcpy(dst, root, root_length);
|
|
||||||
|
|
||||||
if (leaf_length == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
u64 copy_start = root_length;
|
|
||||||
|
|
||||||
if (root_length > 0 && root[root_length - 1] != PATH_SEP && leaf[0] != PATH_SEP) {
|
|
||||||
dst[root_length] = PATH_SEP;
|
|
||||||
++copy_start;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(&(dst[copy_start]), leaf, leaf_length);
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user