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

Function path_split

ccan/ccan/tal/path/path.c:526–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526char **path_split(const tal_t *ctx, const char *path)
527{
528 bool empty = path && !path[0];
529 char **ret = tal_strsplit(ctx, path, PATH_SEP_STR, STR_NO_EMPTY);
530
531 /* Handle the "/" case */
532 if (ret && !empty && !ret[0]) {
533 if (!tal_resize(&ret, 2))
534 ret = tal_free(ret);
535 else {
536 ret[1] = NULL;
537 ret[0] = tal_strdup(ret, PATH_SEP_STR);
538 if (!ret[0])
539 ret = tal_free(ret);
540 }
541 }
542
543 return ret;
544}
545
546size_t path_ext_off(const char *path)
547{

Callers 2

mainFunction · 0.85
relativeFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by 1

mainFunction · 0.68