]> diplodocus.org Git - nmh/commitdiff
Adjust the quoted-printable output routine to continue when the end of
authorKen Hornstein <kenh@pobox.com>
Wed, 5 Feb 2014 16:02:01 +0000 (11:02 -0500)
committerKen Hornstein <kenh@pobox.com>
Wed, 5 Feb 2014 16:02:01 +0000 (11:02 -0500)
the buffer is reached, rather than adding a soft line break.

test/mhbuild/test-cte
uip/mhoutsbr.c

index f1e2b03..1ccfe19 100755 (executable)
@@ -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.
index 9584d78..954ae84 100644 (file)
@@ -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;
 }