diff --git a/lbuf.c b/lbuf.c index 874d4eaef..88f66e056 100644 --- a/lbuf.c +++ b/lbuf.c @@ -245,10 +245,14 @@ lbuf_print(lbuf) cp = lbuf->buf; have = cols; while (cp != NULL && *cp != '\0') { - char *ep = NULL; + char *ep; int need = lbuf->len - (int)(cp - lbuf->buf); - if (need > have) { + ep = memrchr(cp, '\n', need > have ? have : need); + if (ep) { + need = ep - cp; + ep++; /* skip over newline */ + } else if (need > have) { have -= contlen; /* subtract for continuation char */ if ((ep = memrchr(cp, ' ', have)) == NULL) ep = memchr(cp + have, ' ', need - have); diff --git a/parse.c b/parse.c index d4739b0db..fea04dc2d 100644 --- a/parse.c +++ b/parse.c @@ -560,6 +560,8 @@ display_bound_defaults(dtype, lbuf) nfound++; if (binding != tq_first(&d->binding)) { binding = tq_first(&d->binding); + if (nfound != 1) + lbuf_append(lbuf, "\n", NULL); lbuf_append(lbuf, " Defaults", dsep, NULL); for (m = binding; m != NULL; m = m->next) { if (m != binding)