diff options
| author | Richard M. Stallman | 1989-01-25 06:54:36 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1989-01-25 06:54:36 +0000 |
| commit | a492a5b96c24174b191ee72467fb63e64971aecc (patch) | |
| tree | 7fb2f67d8dafd44e7b322c3747fd71f58f8954d9 /lib-src | |
| parent | 497d1817d9f8fc369c8227835764dc50484e4c36 (diff) | |
| download | emacs-a492a5b96c24174b191ee72467fb63e64971aecc.tar.gz emacs-a492a5b96c24174b191ee72467fb63e64971aecc.zip | |
*** empty log message ***
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/fakemail.c | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c index d055c7f38e7..19b053abaa3 100644 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c | |||
| @@ -401,15 +401,49 @@ put_string (s) | |||
| 401 | } | 401 | } |
| 402 | 402 | ||
| 403 | void | 403 | void |
| 404 | put_line (s) | 404 | put_line (string) |
| 405 | char *s; | 405 | char *string; |
| 406 | { | 406 | { |
| 407 | register stream_list rem; | 407 | register stream_list rem; |
| 408 | for (rem = the_streams; | 408 | for (rem = the_streams; |
| 409 | rem != ((stream_list) NULL); | 409 | rem != ((stream_list) NULL); |
| 410 | rem = rem->rest_streams) | 410 | rem = rem->rest_streams) |
| 411 | { | 411 | { |
| 412 | fputs (s, rem->handle); | 412 | char *s = string; |
| 413 | int column = 0; | ||
| 414 | |||
| 415 | /* Divide STRING into lines. */ | ||
| 416 | while (*s != 0) | ||
| 417 | { | ||
| 418 | char *breakpos; | ||
| 419 | |||
| 420 | /* Find the last char that fits. */ | ||
| 421 | for (breakpos = s; *breakpos && column < 78; ++breakpos) | ||
| 422 | { | ||
| 423 | if (*breakpos == '\t') | ||
| 424 | column += 8; | ||
| 425 | else | ||
| 426 | column++; | ||
| 427 | } | ||
| 428 | /* Back up to just after the last comma that fits. */ | ||
| 429 | while (breakpos != s && breakpos[-1] != ',') --breakpos; | ||
| 430 | if (breakpos == s) | ||
| 431 | { | ||
| 432 | /* If no comma fits, move past the first address anyway. */ | ||
| 433 | while (*breakpos != 0 && *breakpos != ',') ++breakpos; | ||
| 434 | if (*breakpos != 0) | ||
| 435 | /* Include the comma after it. */ | ||
| 436 | ++breakpos; | ||
| 437 | } | ||
| 438 | /* Output that much, then break the line. */ | ||
| 439 | fwrite (s, 1, breakpos - s, rem->handle); | ||
| 440 | fputs ("\n\t", rem->handle); | ||
| 441 | column = 8; | ||
| 442 | |||
| 443 | /* Skip whitespace and prepare to print more addresses. */ | ||
| 444 | s = breakpos; | ||
| 445 | while (*s == ' ' || *s == '\t') ++s; | ||
| 446 | } | ||
| 413 | putc ('\n', rem->handle); | 447 | putc ('\n', rem->handle); |
| 414 | } | 448 | } |
| 415 | return; | 449 | return; |