- /* Use at least one word, even if it takes us over maxlen. */
- oldlen = len = strcspn(words, " ");
- while (len <= maxlen) {
- oldlen = len;
- len += strspn(words+len, " ");
- len += strcspn(words+len, " ");
- if (len == oldlen)
- break;
+ /* Leading whitespace at start of line means literal. */
+ if (*start && *prefix) {
+ oldlen = strcspn(words, "\n");
+ } else {
+ /* Use at least one word, even if it takes us over maxlen. */
+ oldlen = len = strcspn(words, " ");
+ while (len <= maxlen) {
+ oldlen = len;
+ len += strspn(words+len, " ");
+ if (words[len] == '\n')
+ break;
+ len += strcspn(words+len, " \n");
+ if (len == oldlen)
+ break;
+ }