~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to recvattach.c

  • Committer: Bazaar Package Importer
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2009-06-17 17:17:28 UTC
  • mfrom: (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20090617171728-61dkl7w5fgn7ybdq
Tags: upstream-1.5.20
Import upstream version 1.5.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
  { N_("Pipe"),  OP_PIPE },
56
56
  { N_("Print"), OP_PRINT },
57
57
  { N_("Help"),  OP_HELP },
58
 
  { NULL }
 
58
  { NULL,        0 }
59
59
};
60
60
 
61
61
void mutt_update_tree (ATTACHPTR **idx, short idxlen)
433
433
  {
434
434
    if (mutt_get_field (prompt, buf, sizeof (buf), M_FILE | M_CLEAR) != 0
435
435
        || !buf[0])
 
436
    {
 
437
      mutt_clear_error ();
436
438
      return -1;
 
439
    }
437
440
    
438
441
    prompt = NULL;
439
442
    mutt_expand_path (buf, sizeof (buf));
518
521
          if (rc == 0 && AttachSep && (fpout = fopen (tfile,"a")) != NULL)
519
522
          {
520
523
            fprintf(fpout, "%s", AttachSep);
521
 
            fclose (fpout);
 
524
            safe_fclose (&fpout);
522
525
          }
523
526
        }
524
527
        else
527
530
          if (rc == 0 && AttachSep && (fpout = fopen (tfile,"a")) != NULL)
528
531
          {
529
532
            fprintf(fpout, "%s", AttachSep);
530
 
            fclose (fpout);
 
533
            safe_fclose (&fpout);
531
534
          }
532
535
        }
533
536
      }
622
625
      return;
623
626
    }
624
627
    mutt_copy_stream (ifp, state->fpout);
625
 
    fclose (ifp);
 
628
    safe_fclose (&ifp);
626
629
    if (AttachSep)
627
630
      state_puts (AttachSep, state);
628
631
  }
671
674
    mutt_endwin (NULL);
672
675
    thepid = mutt_create_filter (buf, &state.fpout, NULL, NULL);
673
676
    pipe_attachment_list (buf, fp, tag, top, filter, &state);
674
 
    fclose (state.fpout);
 
677
    safe_fclose (&state.fpout);
675
678
    if (mutt_wait_filter (thepid) != 0 || option (OPTWAITKEY))
676
679
      mutt_any_key_to_continue (NULL);
677
680
  }
737
740
            if ((ifp = fopen (newfile, "r")) != NULL)
738
741
            {
739
742
              mutt_copy_stream (ifp, state->fpout);
740
 
              fclose (ifp);
 
743
              safe_fclose (&ifp);
741
744
              if (AttachSep)
742
745
                state_puts (AttachSep, state);
743
746
            }
771
774
    memset (&state, 0, sizeof (STATE));
772
775
    thepid = mutt_create_filter (NONULL (PrintCmd), &state.fpout, NULL, NULL);
773
776
    print_attachment_list (fp, tag, top, &state);
774
 
    fclose (state.fpout);
 
777
    safe_fclose (&state.fpout);
775
778
    if (mutt_wait_filter (thepid) != 0 || option (OPTWAITKEY))
776
779
      mutt_any_key_to_continue (NULL);
777
780
  }
1242
1245
 
1243
1246
        if (WithCrypto && need_secured && secured)
1244
1247
        {
1245
 
          fclose (fp);
 
1248
          safe_fclose (&fp);
1246
1249
          mutt_free_body (&cur);
1247
1250
        }
1248
1251