/[mailutils]/mailutils/mail/util.c
ViewVC logotype

Diff of /mailutils/mail/util.c

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

revision 1.50 by gray, Tue Dec 10 15:02:21 2002 UTC revision 1.51 by polak, Mon Dec 23 22:01:34 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, 2002 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 "mail.h"  #include "mail.h"
# Line 148  util_do_command (const char *c, ...) Line 148  util_do_command (const char *c, ...)
148      }      }
149    else    else
150      {      {
151        util_error ("Unknown command: %s", argv[0]);        util_error (_("Unknown command: %s"), argv[0]);
152        status = 1;        status = 1;
153      }      }
154    
# Line 390  util_getenv (void *ptr, const char *vari Line 390  util_getenv (void *ptr, const char *vari
390    if (!mail_env_entry_is_set (env) || env->type != type)    if (!mail_env_entry_is_set (env) || env->type != type)
391      {      {
392        if (warn)        if (warn)
393          util_error ("No value set for \"%s\"", variable);          util_error (_("No value set for \"%s\""), variable);
394        return 1;        return 1;
395      }      }
396    if (ptr)    if (ptr)
# Line 488  util_printenv (int set) Line 488  util_printenv (int set)
488                break;                break;
489                                
490              case Mail_env_whatever:              case Mail_env_whatever:
491                fprintf (ofile, "oops?");                fprintf (ofile, _("oops?"));
492              }              }
493            fprintf (ofile, "\n");            fprintf (ofile, "\n");
494          }          }
# Line 583  util_get_homedir () Line 583  util_get_homedir ()
583    if (!homedir)    if (!homedir)
584      {      {
585        /* Shouldn't happen, but one never knows */        /* Shouldn't happen, but one never knows */
586        util_error ("can't get homedir");        util_error (_("can't get homedir"));
587        exit (EXIT_FAILURE);        exit (EXIT_FAILURE);
588      }      }
589    return homedir;    return homedir;
# Line 646  util_get_sender(int msgno, int strip) Line 646  util_get_sender(int msgno, int strip)
646        if (envelope_sender (env, buffer, sizeof (buffer), NULL)        if (envelope_sender (env, buffer, sizeof (buffer), NULL)
647            || address_create (&addr, buffer))            || address_create (&addr, buffer))
648          {          {
649            util_error("can't determine sender name (msg %d)", msgno);            util_error (_("can't determine sender name (msg %d)"), msgno);
650            return NULL;            return NULL;
651          }          }
652      }      }
653    
654    if (address_get_email (addr, 1, buffer, sizeof(buffer), NULL))    if (address_get_email (addr, 1, buffer, sizeof(buffer), NULL))
655      {      {
656        util_error("can't determine sender name (msg %d)", msgno);        util_error (_("can't determine sender name (msg %d)"), msgno);
657        address_destroy (&addr);        address_destroy (&addr);
658        return NULL;        return NULL;
659      }      }
# Line 721  util_slist_add (list_t *list, char *valu Line 721  util_slist_add (list_t *list, char *valu
721    
722    if ((p = strdup(value)) == NULL)    if ((p = strdup(value)) == NULL)
723      {      {
724        util_error("not enough memory\n");        util_error(_("not enough memory\n"));
725        return;        return;
726      }      }
727    list_append (*list, p);    list_append (*list, p);
# Line 879  util_save_outgoing (message_t msg, char Line 879  util_save_outgoing (message_t msg, char
879        outfile = fopen (filename, "a");        outfile = fopen (filename, "a");
880        if (!outfile)        if (!outfile)
881          {          {
882            util_error("can't open save file %s: %s",            util_error(_("can't open save file %s: %s"),
883                       filename, strerror (errno));                       filename, strerror (errno));
884          }          }
885        else        else
# Line 896  util_save_outgoing (message_t msg, char Line 896  util_save_outgoing (message_t msg, char
896    
897            if (!bsize)            if (!bsize)
898              {              {
899                util_error("not enough memory for creating save file");                util_error(_("not enough memory for creating save file"));
900              }              }
901            else            else
902              {              {
# Line 981  util_help (const struct mail_command_ent Line 981  util_help (const struct mail_command_ent
981        else        else
982          {          {
983            status = 1;            status = 1;
984            fprintf (stdout, "Unknown command: %s\n", word);            fprintf (stdout, _("Unknown command: %s\n"), word);
985          }          }
986        return status;        return status;
987      }      }
# Line 1006  util_descend_subparts (message_t mesg, m Line 1006  util_descend_subparts (message_t mesg, m
1006          {          {
1007            if (message_unencapsulate (mesg, &submsg, NULL))            if (message_unencapsulate (mesg, &submsg, NULL))
1008              {              {
1009                util_error ("can't unencapsulate message/part");                util_error (_("can't unencapsulate message/part"));
1010                return 1;                return 1;
1011              }              }
1012            mesg = submsg;            mesg = submsg;
# Line 1015  util_descend_subparts (message_t mesg, m Line 1015  util_descend_subparts (message_t mesg, m
1015        message_get_num_parts (mesg, &nparts);        message_get_num_parts (mesg, &nparts);
1016        if (nparts < msgset->msg_part[i])        if (nparts < msgset->msg_part[i])
1017          {          {
1018            util_error ("no such (sub)part in the message: %d",            util_error (_("no such (sub)part in the message: %d"),
1019                        msgset->msg_part[i]);                        msgset->msg_part[i]);
1020            return 1;            return 1;
1021          }          }
1022    
1023        if (message_get_part (mesg, msgset->msg_part[i], &submsg))        if (message_get_part (mesg, msgset->msg_part[i], &submsg))
1024          {          {
1025            util_error ("can't get (sub)part from the message: %d",            util_error (_("can't get (sub)part from the message: %d"),
1026                        msgset->msg_part[i]);                        msgset->msg_part[i]);
1027            return 1;            return 1;
1028          }          }
# Line 1146  util_header_expand (header_t *phdr) Line 1146  util_header_expand (header_t *phdr)
1146    rc = header_create (&hdr, "", 0, NULL);    rc = header_create (&hdr, "", 0, NULL);
1147    if (rc)    if (rc)
1148      {      {
1149        util_error ("can't create temporary header: %s", mu_errstring (rc));        util_error (_("can't create temporary header: %s"), mu_errstring (rc));
1150        return 1;        return 1;
1151      }      }
1152                
# Line 1187  util_header_expand (header_t *phdr) Line 1187  util_header_expand (header_t *phdr)
1187                  {                  {
1188                    errcnt++;                    errcnt++;
1189                    if (exp)                    if (exp)
1190                      util_error ("can't parse address `%s' (while expanding `%s'): %s",                      util_error (_("can't parse address `%s' (while expanding `%s'): %s"),
1191                                  exp, p, mu_errstring (rc));                                  exp, p, mu_errstring (rc));
1192                    else                    else
1193                      util_error ("can't parse address `%s': %s",                      util_error (_("can't parse address `%s': %s"),
1194                                  p, mu_errstring (rc));                                  p, mu_errstring (rc));
1195                  }                  }
1196                                
# Line 1243  util_get_message (mailbox_t mbox, size_t Line 1243  util_get_message (mailbox_t mbox, size_t
1243    status = mailbox_get_message (mbox, msgno, msg);    status = mailbox_get_message (mbox, msgno, msg);
1244    if (status)    if (status)
1245      {      {
1246        util_error ("can't get message %lu: %s",        util_error (_("can't get message %lu: %s"),
1247                    (unsigned long) msgno, mu_errstring (status));                    (unsigned long) msgno, mu_errstring (status));
1248        return status;        return status;
1249      }      }
# Line 1251  util_get_message (mailbox_t mbox, size_t Line 1251  util_get_message (mailbox_t mbox, size_t
1251    if ((flag & MSG_NODELETED) && util_isdeleted (*msg))    if ((flag & MSG_NODELETED) && util_isdeleted (*msg))
1252      {      {
1253        if (!(flag & MSG_SILENT))        if (!(flag & MSG_SILENT))
1254          util_error ("%lu: Inappropriate message (has been deleted)",          util_error (_("%lu: Inappropriate message (has been deleted)"),
1255                      (unsigned long) msgno);                      (unsigned long) msgno);
1256        return ENOENT;        return ENOENT;
1257      }      }
# Line 1261  util_get_message (mailbox_t mbox, size_t Line 1261  util_get_message (mailbox_t mbox, size_t
1261  int  int
1262  util_error_range (size_t msgno)  util_error_range (size_t msgno)
1263  {  {
1264    util_error ("%d: invalid message number", msgno);    util_error (_("%d: invalid message number"), msgno);
1265    return 1;    return 1;
1266  }  }

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

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