/[mailutils]/mailutils/guimb/collect.c
ViewVC logotype

Diff of /mailutils/guimb/collect.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by gray, Wed Feb 27 11:54:47 2002 UTC revision 1.10 by polak, Tue Dec 24 08:25:36 2002 UTC
# Line 1  Line 1 
1  /* GNU mailutils - a suite of utilities for electronic mail  /* GNU Mailutils -- a suite of utilities for electronic mail
2     Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.     Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3    
4     This program is free software; you can redistribute it and/or modify     GNU Mailutils is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2, or (at your option)     the Free Software Foundation; either version 2, or (at your option)
7     any later version.     any later version.
8    
9     This program is distributed in the hope that it will be useful,     GNU Mailutils is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.     GNU General Public License for more details.
13    
14     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software     along with GNU Mailutils; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
17    
18  #include "guimb.h"  #include "guimb.h"
# Line 31  collect_open_default () Line 31  collect_open_default ()
31        asprintf (&default_mailbox, "%s%s", mu_path_maildir, user_name);        asprintf (&default_mailbox, "%s%s", mu_path_maildir, user_name);
32        if (!default_mailbox)        if (!default_mailbox)
33          {          {
34            util_error ("not enough memory");            util_error (_("not enough memory"));
35            exit (1);            exit (1);
36          }          }
37      }      }
38    if (mailbox_create (&mbox, default_mailbox) != 0    if (mailbox_create (&mbox, default_mailbox) != 0
39        || mailbox_open (mbox, MU_STREAM_RDWR) != 0)        || mailbox_open (mbox, MU_STREAM_RDWR) != 0)
40      {      {
41        util_error ("can't open default mailbox %s: %s",        util_error (_("can't open default mailbox %s: %s"),
42                    default_mailbox, mu_errstring (errno));                    default_mailbox, mu_errstring (errno));
43        exit (1);        exit (1);
44      }      }
# Line 82  collect_append_file (char *name) Line 82  collect_append_file (char *name)
82        fp = fopen (name, "r");        fp = fopen (name, "r");
83        if (!fp)        if (!fp)
84          {          {
85            util_error ("can't open input file %s: %s", name, strerror (errno));            util_error (_("can't open input file %s: %s"), name, strerror (errno));
86            return -1;            return -1;
87          }          }
88      }      }
# Line 110  collect_create_mailbox () Line 110  collect_create_mailbox ()
110    if (mailbox_create (&mbox, temp_filename) != 0    if (mailbox_create (&mbox, temp_filename) != 0
111        || mailbox_open (mbox, MU_STREAM_READ) != 0)        || mailbox_open (mbox, MU_STREAM_READ) != 0)
112      {      {
113        util_error ("can't create temp mailbox %s: %s",        util_error (_("can't create temp mailbox %s: %s"),
114                    temp_filename, strerror (errno));                    temp_filename, strerror (errno));
115        unlink (temp_filename);        unlink (temp_filename);
116        exit (1);        exit (1);
# Line 121  collect_create_mailbox () Line 121  collect_create_mailbox ()
121    
122    if (nmesg == 0)    if (nmesg == 0)
123      {      {
124        util_error ("input format not recognized");        util_error (_("input format not recognized"));
125        exit (1);        exit (1);
126      }      }
127  }  }
# Line 146  collect_output () Line 146  collect_output ()
146        || mailbox_open (outbox, MU_STREAM_RDWR|MU_STREAM_CREAT) != 0)        || mailbox_open (outbox, MU_STREAM_RDWR|MU_STREAM_CREAT) != 0)
147      {      {
148        mailbox_destroy (&outbox);        mailbox_destroy (&outbox);
149        fprintf (stderr, "guimb: can't open output mailbox %s: %s\n",        fprintf (stderr, _("guimb: can't open output mailbox %s: %s\n"),
150                 default_mailbox, strerror (errno));                 default_mailbox, strerror (errno));
151        return 1;        return 1;
152      }      }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26