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

Function configvar_unparsed

common/configvar.c:26–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26const struct opt_table *configvar_unparsed(struct configvar *cv)
27{
28 const struct opt_table *ot;
29
30 if (cv->src == CONFIGVAR_CMDLINE_SHORT) {
31 ot = opt_find_short(cv->configline[0]);
32 cv->optarg = NULL;
33 } else {
34 ot = opt_find_long(cv->configline, cast_const2(const char **, &cv->optarg));
35 }
36 if (!ot)
37 return NULL;
38
39 /* We get called multiple times, but we're expected to always
40 * finish the cv vars, even if they're added at the last minute
41 * on the cmdline, so we check this is only done once, and we
42 * do it even if we're not going to use it now. */
43 if (!cv->optvar) {
44 /* optvar is up to the = (i.e. one char before optarg) */
45 if (!cv->optarg)
46 cv->optvar = cv->configline;
47 else
48 cv->optvar = tal_strndup(cv, cv->configline,
49 cv->optarg - cv->configline - 1);
50 }
51 return ot;
52}
53
54static void trim_whitespace(char *s)
55{

Callers 2

configvar_updatedFunction · 0.85
configvar_parseFunction · 0.85

Calls 2

opt_find_shortFunction · 0.85
opt_find_longFunction · 0.85

Tested by

no test coverage detected