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

Function path_cwd

ccan/ccan/tal/path/path.c:14–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#include <assert.h>
13
14char *path_cwd(const tal_t *ctx)
15{
16 size_t len = 64;
17 char *cwd;
18
19 /* *This* is why people hate C. */
20 cwd = tal_arr(ctx, char, len);
21 while (cwd && !getcwd(cwd, len)) {
22 if (errno != ERANGE || !tal_resize(&cwd, len *= 2))
23 cwd = tal_free(cwd);
24 }
25 return cwd;
26}
27
28char *path_join(const tal_t *ctx, const char *base, const char *a)
29{

Callers 10

path_pushdFunction · 0.85
path_canonFunction · 0.85
mainFunction · 0.85
find_my_abspathFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
opt_set_abspathFunction · 0.85
default_base_configdirFunction · 0.85
initial_config_optsFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by 2

mainFunction · 0.68
mainFunction · 0.68