From 01823c4380c75080e6483a7a21f1a41d21a75b46 Mon Sep 17 00:00:00 2001 From: Michael Hampton Date: Mon, 2 Dec 2002 11:24:30 +0000 Subject: [PATCH] * Don't eat too much whitespace in new formatter --- citadel/commands.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/citadel/commands.c b/citadel/commands.c index 725797639..1f1bc62c9 100644 --- a/citadel/commands.c +++ b/citadel/commands.c @@ -1512,12 +1512,13 @@ int fmout2( } column++; } + continue; } - old = *e; /* Or are we looking at a space? */ if (*e == ' ') { e++; if (column >= width - 1) { + /* Are we in the rightmost column? */ if (fpout) { fprintf(fpout, "\n"); } else { @@ -1527,6 +1528,7 @@ int fmout2( } column = 0; } else if (!(column == 0 && old == ' ')) { + /* Eat the first space on a line */ if (fpout) { fprintf(fpout, " "); } else { @@ -1534,8 +1536,11 @@ int fmout2( } column++; } + /* ONLY eat the FIRST space on a line */ + old = 0; continue; } + old = *e; /* Read a word, slightly messy */ i = 0; @@ -1607,6 +1612,15 @@ int fmout2( free(word); if (fpin) /* We allocated this, remember? */ free(buffer); + + if (fpout) { + fprintf(fpout, "\n"); + } else { + scr_printf("\n"); + ++lines_printed; + lines_printed = checkpagin(lines_printed, pagin, height); + } + return sigcaught; } -- 2.39.2