aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-02-16 20:53:00 +0000
committerRichard M. Stallman1994-02-16 20:53:00 +0000
commitfbffe7d98781b448ff10adba66af5adf33fc6d49 (patch)
tree884fe27a95899bd687197c90dd253a786d563650 /lib-src
parentf7da6740cab88c131a7418e08830f35afbe1c5b3 (diff)
downloademacs-fbffe7d98781b448ff10adba66af5adf33fc6d49.tar.gz
emacs-fbffe7d98781b448ff10adba66af5adf33fc6d49.zip
(put_line): Don't break the line if it all fits.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/fakemail.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c
index 145e51efd01..757b4e1cb6b 100644
--- a/lib-src/fakemail.c
+++ b/lib-src/fakemail.c
@@ -421,7 +421,7 @@ put_line (string)
421 { 421 {
422 char *breakpos; 422 char *breakpos;
423 423
424 /* Find the last char that fits. */ 424 /* Find the last char that fits. */
425 for (breakpos = s; *breakpos && column < 78; ++breakpos) 425 for (breakpos = s; *breakpos && column < 78; ++breakpos)
426 { 426 {
427 if (*breakpos == '\t') 427 if (*breakpos == '\t')
@@ -429,15 +429,20 @@ put_line (string)
429 else 429 else
430 column++; 430 column++;
431 } 431 }
432 /* Back up to just after the last comma that fits. */ 432 /* If we didn't reach end of line, break the line. */
433 while (breakpos != s && breakpos[-1] != ',') --breakpos; 433 if (*breakpos)
434 if (breakpos == s)
435 { 434 {
436 /* If no comma fits, move past the first address anyway. */ 435 /* Back up to just after the last comma that fits. */
437 while (*breakpos != 0 && *breakpos != ',') ++breakpos; 436 while (breakpos != s && breakpos[-1] != ',') --breakpos;
438 if (*breakpos != 0) 437
439 /* Include the comma after it. */ 438 if (breakpos == s)
440 ++breakpos; 439 {
440 /* If no comma fits, move past the first address anyway. */
441 while (*breakpos != 0 && *breakpos != ',') ++breakpos;
442 if (*breakpos != 0)
443 /* Include the comma after it. */
444 ++breakpos;
445 }
441 } 446 }
442 /* Output that much, then break the line. */ 447 /* Output that much, then break the line. */
443 fwrite (s, 1, breakpos - s, rem->handle); 448 fwrite (s, 1, breakpos - s, rem->handle);