mhn: minor fix in edit mode.
* mh/mhn.c (mhn_edit): Increase line_count after outputting a line with a stripped-off initial #.
Showing
2 changed files
with
15 additions
and
8 deletions
... | @@ -2493,7 +2493,10 @@ mhn_edit (struct compose_env *env, int level) | ... | @@ -2493,7 +2493,10 @@ mhn_edit (struct compose_env *env, int level) |
2493 | if (buf[0] == '#') | 2493 | if (buf[0] == '#') |
2494 | { | 2494 | { |
2495 | if (buf[1] == '#') | 2495 | if (buf[1] == '#') |
2496 | mu_stream_write (output, buf+1, n-1, NULL); | 2496 | { |
2497 | mu_stream_write (output, buf+1, n-1, NULL); | ||
2498 | line_count++; | ||
2499 | } | ||
2497 | else | 2500 | else |
2498 | { | 2501 | { |
2499 | char *b2 = NULL; | 2502 | char *b2 = NULL; |
... | @@ -2518,13 +2521,15 @@ mhn_edit (struct compose_env *env, int level) | ... | @@ -2518,13 +2521,15 @@ mhn_edit (struct compose_env *env, int level) |
2518 | } | 2521 | } |
2519 | free (b2); | 2522 | free (b2); |
2520 | 2523 | ||
2521 | mu_stream_close (output); | ||
2522 | mu_stream_destroy (&output); | ||
2523 | 2524 | ||
2524 | if (line_count) | 2525 | if (line_count) |
2525 | /* Close and append the previous part */ | 2526 | { |
2526 | finish_text_msg (env, &msg, ascii_buf); | 2527 | /* Close and append the previous part */ |
2527 | 2528 | mu_stream_close (output); | |
2529 | mu_stream_destroy (&output); | ||
2530 | finish_text_msg (env, &msg, ascii_buf); | ||
2531 | } | ||
2532 | |||
2528 | mu_rtrim_cset (buf, "\n"); | 2533 | mu_rtrim_cset (buf, "\n"); |
2529 | 2534 | ||
2530 | /* Execute the directive */ | 2535 | /* Execute the directive */ | ... | ... |
... | @@ -364,7 +364,8 @@ Initial text. | ... | @@ -364,7 +364,8 @@ Initial text. |
364 | [mhn: don't know how to display content (content application/x-tar in message 1, part 2) | 364 | [mhn: don't know how to display content (content application/x-tar in message 1, part 2) |
365 | ]) | 365 | ]) |
366 | 366 | ||
367 | MH_CHECK([mhn-show- variable (with subtype)],[mhn15 mhn-show-with-subtype],[ | 367 | MH_CHECK([mhn-show- variable (with subtype)], |
368 | [mhn15 mhn-show-with-subtype],[ | ||
368 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mime,[Mail/inbox]) | 369 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mime,[Mail/inbox]) |
369 | echo "mhn-show-application/x-tar: %ltar tvf '%F'" >> $MH | 370 | echo "mhn-show-application/x-tar: %ltar tvf '%F'" >> $MH |
370 | mhn -show 1 | sed '/^X-IMAPbase/d;s/ *$//' | 371 | mhn -show 1 | sed '/^X-IMAPbase/d;s/ *$//' |
... | @@ -387,7 +388,8 @@ part 2 application/x-tar 13835 | ... | @@ -387,7 +388,8 @@ part 2 application/x-tar 13835 |
387 | -rw-r--r-- gray/staff 937 2010-11-29 13:58 Jabberwocky | 388 | -rw-r--r-- gray/staff 937 2010-11-29 13:58 Jabberwocky |
388 | ]) | 389 | ]) |
389 | 390 | ||
390 | MH_CHECK([mhn-show- variable (with subtype)],[mhn16 mhn-show-without-subtype],[ | 391 | MH_CHECK([mhn-show- variable (without subtype)], |
392 | [mhn16 mhn-show-without-subtype],[ | ||
391 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mime,[Mail/inbox]) | 393 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mime,[Mail/inbox]) |
392 | echo "mhn-show-application: %ltar tvf '%F'" >> $MH | 394 | echo "mhn-show-application: %ltar tvf '%F'" >> $MH |
393 | mhn -show 1 | sed '/^X-IMAPbase/d;s/ *$//' | 395 | mhn -show 1 | sed '/^X-IMAPbase/d;s/ *$//' | ... | ... |
-
Please register or sign in to post a comment