Messing with wordwrap

This commit is contained in:
Andrew Pamment 2018-05-25 22:38:11 +10:00
parent 759b5a3adb
commit 0ebdbe71b4

View File

@ -763,6 +763,7 @@ static char *www_wordwrap(char *content, int cutoff) {
int at = 0;
int extra = 0;
int quote_line = 0;
int z;
for (i=0;i<len;i++) {
if (content[i] == '\n') {
@ -786,7 +787,8 @@ static char *www_wordwrap(char *content, int cutoff) {
line_count = 0;
quote_line = 0;
} else if (quote_line != 1) {
if (at > 0 && content[at-1] != '\r' && content[at-1] != ' ') {
for (z = i+1;content[z] != ' ' && z < len;z++);
if (at > 0 && content[at-1] != '\r' && content[at-1] != ' ' && cutoff - line_count < z) {
content[at++] = ' ';
line_count++;
}