From: Ken Hornstein Date: Wed, 5 Feb 2014 16:02:01 +0000 (-0500) Subject: Adjust the quoted-printable output routine to continue when the end of X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/643c6553f171fa5b04a017da16f9283467497355?ds=sidebyside Adjust the quoted-printable output routine to continue when the end of the buffer is reached, rather than adding a soft line break. --- diff --git a/test/mhbuild/test-cte b/test/mhbuild/test-cte index f1e2b031..1ccfe199 100755 --- a/test/mhbuild/test-cte +++ b/test/mhbuild/test-cte @@ -275,11 +275,11 @@ rential calculus; I know the scientific names of beings animalculous: In s= hort, in matters vegetable, animal, and mineral, I am the very model of a = modern Major-General. I know our mythic history, King Arthur's and Sir Car= adoc's; I answer hard acrostics, I've a pretty taste for paradox, I quote = -in elegiacs all the crimes of Heliogabalus, In conics I can = -floor peculiarities parabolous; I can tell undoubted Raphaels from Gerard = -Dows and Zoffanies, I know the croaking chorus from The Frogs of Aristopha= -nes! Then I can hum a fugue of which I've heard the music's din afore, An= -d whistle all the airs from that infernal nonsense Pinafore. = +in elegiacs all the crimes of Heliogabalus, In conics I can floor peculiar= +ities parabolous; I can tell undoubted Raphaels from Gerard Dows and Zoffa= +nies, I know the croaking chorus from The Frogs of Aristophanes! Then I c= +an hum a fugue of which I've heard the music's din afore, And whistle all = +the airs from that infernal nonsense Pinafore. = This is a second line. @@ -320,11 +320,11 @@ rential calculus; I know the scientific names of beings animalculous: In s= hort, in matters vegetable, animal, and mineral, I am the very model of a = modern Major-General. I know our mythic history, King Arthur's and Sir Car= adoc's; I answer hard acrostics, I've a pretty taste for paradox, I quote = -in elegiacs all the crimes of Heliogabalus, In conics I can = -floor peculiarities parabolous; I can tell undoubted Raphaels from Gerard = -Dows and Zoffanies, I know the croaking chorus from The Frogs of Aristopha= -nes! Then I can hum a fugue of which I've heard the music's din afore, An= -d whistle all the airs from that infernal nonsense Pinafore. = +in elegiacs all the crimes of Heliogabalus, In conics I can floor peculiar= +ities parabolous; I can tell undoubted Raphaels from Gerard Dows and Zoffa= +nies, I know the croaking chorus from The Frogs of Aristophanes! Then I c= +an hum a fugue of which I've heard the music's din afore, And whistle all = +the airs from that infernal nonsense Pinafore. = This is a sec=C3=B6nd line. diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index 9584d789..954ae841 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -328,13 +328,13 @@ writeQuoted (CT ct, FILE *out) char *cp, *file; char c, buffer[BUFSIZ]; CE ce = &ct->c_cefile; + int n = 0; file = NULL; if ((fd = (*ct->c_ceopenfnx) (ct, &file)) == NOTOK) return NOTOK; while (fgets (buffer, sizeof(buffer) - 1, ce->ce_fp)) { - int n; cp = buffer + strlen (buffer) - 1; if ((c = *cp) == '\n') @@ -342,10 +342,9 @@ writeQuoted (CT ct, FILE *out) if (strncmp (cp = buffer, "From ", sizeof("From ") - 1) == 0) { fprintf (out, "=%02X", *cp++ & 0xff); - n = 3; - } else { - n = 0; + n += 3; } + for (; *cp; cp++) { if (n > CPERLIN - 3) { fputs ("=\n", out); @@ -379,11 +378,13 @@ three_print: fputs ("=\n", out); putc ('\n', out); - } else { - fputs ("=\n", out); + n = 0; } } + if (c != '\n') + putc ('\n', out); + (*ct->c_ceclosefnx) (ct); return OK; }