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) ...@@ -47,7 +47,7 @@ static size_t consume_words(const char *words, size_t maxlen, size_t *prefix)
size_t oldlen, len; size_t oldlen, len;
/* Swallow leading whitespace. */ /* Swallow leading whitespace. */
*prefix = strspn(words, " "); *prefix = strspn(words, " \n");
words += *prefix; words += *prefix;
/* Use at least one word, even if it takes us over maxlen. */ /* 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) ...@@ -55,7 +55,9 @@ static size_t consume_words(const char *words, size_t maxlen, size_t *prefix)
while (len <= maxlen) { while (len <= maxlen) {
oldlen = len; oldlen = len;
len += strspn(words+len, " "); len += strspn(words+len, " ");
len += strcspn(words+len, " "); if (words[len] == '\n')
break;
len += strcspn(words+len, " \n");
if (len == oldlen) if (len == oldlen)
break; 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