Commit 13b37485 authored by Luke Dashjr's avatar Luke Dashjr Committed by Rusty Russell

opt: accept newline in help strings

This correctly continues on the next line indented.
Signed-off-by: default avatarLuke Dashjr <luke-jr+git@utopios.org>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 2e26b06e
......@@ -47,7 +47,7 @@ static size_t consume_words(const char *words, size_t maxlen, size_t *prefix)
size_t oldlen, len;
/* Swallow leading whitespace. */
*prefix = strspn(words, " ");
*prefix = strspn(words, " \n");
words += *prefix;
/* Use at least one word, even if it takes us over maxlen. */
......@@ -55,7 +55,9 @@ static size_t consume_words(const char *words, size_t maxlen, size_t *prefix)
while (len <= maxlen) {
oldlen = len;
len += strspn(words+len, " ");
len += strcspn(words+len, " ");
if (words[len] == '\n')
break;
len += strcspn(words+len, " \n");
if (len == oldlen)
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment