Commit b6bef8d7 b6bef8d7420babdc452f6cbd9ce5327640a8981a by Sergey Poznyakoff

Handle interrupts when fetching message body.

1 parent 7af90e80
...@@ -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 }
......