This correctly continues on the next line indented.
Signed-off-by: Luke Dashjr <luke-jr+git@utopios.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
size_t oldlen, len;
/* Swallow leading whitespace. */
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. */
words += *prefix;
/* Use at least one word, even if it takes us over maxlen. */
while (len <= maxlen) {
oldlen = len;
len += strspn(words+len, " ");
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;
}
if (len == oldlen)
break;
}