Handle interrupts when fetching message body.
Showing
1 changed file
with
6 additions
and
1 deletions
... | @@ -81,6 +81,11 @@ mail_print (int argc, char **argv) | ... | @@ -81,6 +81,11 @@ mail_print (int argc, char **argv) |
81 | while (stream_read (stream, buffer, sizeof (buffer) - 1, off, &n) == 0 | 81 | while (stream_read (stream, buffer, sizeof (buffer) - 1, off, &n) == 0 |
82 | && n != 0) | 82 | && n != 0) |
83 | { | 83 | { |
84 | if (ml_got_interrupt()) | ||
85 | { | ||
86 | util_error("\nInterrupt"); | ||
87 | break; | ||
88 | } | ||
84 | buffer[n] = '\0'; | 89 | buffer[n] = '\0'; |
85 | fprintf (out, "%s", buffer); | 90 | fprintf (out, "%s", buffer); |
86 | off += n; | 91 | off += n; |
... | @@ -89,7 +94,7 @@ mail_print (int argc, char **argv) | ... | @@ -89,7 +94,7 @@ mail_print (int argc, char **argv) |
89 | pclose (out); | 94 | pclose (out); |
90 | 95 | ||
91 | message_get_attribute (mesg, &attr); | 96 | message_get_attribute (mesg, &attr); |
92 | attribute_set_read (attr); | 97 | attribute_set_seen (attr); |
93 | 98 | ||
94 | return 0; | 99 | return 0; |
95 | } | 100 | } | ... | ... |
-
Please register or sign in to post a comment