Browse Source

options: don't end default name with '-' in non-DEVELOPER mode.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
fee-tracking2
Rusty Russell 6 years ago
parent
commit
aa9e15edb0
  1. 6
      lightningd/options.c

6
lightningd/options.c

@ -777,16 +777,16 @@ void setup_color_and_alias(struct lightningd *ld)
adjective %= ARRAY_SIZE(codename_adjective); adjective %= ARRAY_SIZE(codename_adjective);
/* Only use 32 characters */ /* Only use 32 characters */
name = tal_fmt(ld, "%s%s-", name = tal_fmt(ld, "%s%s",
codename_adjective[adjective], codename_adjective[adjective],
codename_noun[noun]); codename_noun[noun]);
#if DEVELOPER #if DEVELOPER
assert(strlen(name) < 32); assert(strlen(name) < 32);
int taillen = 32 - strlen(name); int taillen = 31 - strlen(name);
if (taillen > strlen(version())) if (taillen > strlen(version()))
taillen = strlen(version()); taillen = strlen(version());
/* Fit as much of end of version() as possible */ /* Fit as much of end of version() as possible */
tal_append_fmt(&name, "%s", tal_append_fmt(&name, "-%s",
version() + strlen(version()) - taillen); version() + strlen(version()) - taillen);
#endif #endif
assert(strlen(name) <= 32); assert(strlen(name) <= 32);

Loading…
Cancel
Save