MCPcopy Create free account
hub / github.com/ElementsProject/lightning / path_split

Function path_split

ccan/ccan/tal/path/path.c:549–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547}
548
549char **path_split(const tal_t *ctx, const char *path)
550{
551 bool empty = path && !path[0];
552 char **ret = tal_strsplit(ctx, path, PATH_SEP_STR, STR_NO_EMPTY);
553
554 /* Handle the "/" case */
555 if (ret && !empty && !ret[0]) {
556 if (!tal_resize(&ret, 2))
557 ret = tal_free(ret);
558 else {
559 ret[1] = NULL;
560 ret[0] = tal_strdup(ret, PATH_SEP_STR);
561 if (!ret[0])
562 ret = tal_free(ret);
563 }
564 }
565
566 return ret;
567}
568
569size_t path_ext_off(const char *path)
570{

Callers 2

mainFunction · 0.85
relativeFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by 1

mainFunction · 0.68