1 |
/* GNU mailutils - a suite of utilities for electronic mail |
/* GNU Mailutils -- a suite of utilities for electronic mail |
2 |
Copyright (C) 1999, 2001 Free Software Foundation, Inc. |
Copyright (C) 1999, 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 |
/* Functions for handling escape variables */ |
/* Functions for handling escape variables */ |
55 |
|
|
56 |
if ((status = header_create (&header, NULL, 0, NULL)) != 0) |
if ((status = header_create (&header, NULL, 0, NULL)) != 0) |
57 |
{ |
{ |
58 |
util_error ("can't create header: %s", mu_errstring (status)); |
util_error (_("can't create header: %s"), mu_errstring (status)); |
59 |
return 1; |
return 1; |
60 |
} |
} |
61 |
|
|
91 |
} |
} |
92 |
else |
else |
93 |
{ |
{ |
94 |
util_error ("%d: not a header line", line); |
util_error (_("%d: not a header line"), line); |
95 |
errcnt++; |
errcnt++; |
96 |
} |
} |
97 |
} |
} |
117 |
} |
} |
118 |
else |
else |
119 |
{ |
{ |
120 |
util_error ("%d: not a header line", line); |
util_error (_("%d: not a header line"), line); |
121 |
errcnt++; |
errcnt++; |
122 |
} |
} |
123 |
} |
} |
138 |
char *p; |
char *p; |
139 |
|
|
140 |
header_destroy (&header, NULL); |
header_destroy (&header, NULL); |
141 |
p = ml_readline ("Edit again?"); |
p = ml_readline (_("Edit again?")); |
142 |
if (*p == 'y' || *p == 'Y') |
if (*p == 'y' || *p == 'Y') |
143 |
return -1; |
return -1; |
144 |
else |
else |
153 |
static void |
static void |
154 |
var_continue (void) |
var_continue (void) |
155 |
{ |
{ |
156 |
fprintf (stdout, "(continue)\n"); |
fprintf (stdout, _("(continue)\n")); |
157 |
} |
} |
158 |
|
|
159 |
static int |
static int |
163 |
{ |
{ |
164 |
char *escape = "~"; |
char *escape = "~"; |
165 |
util_getenv (&escape, "escape", Mail_env_string, 0); |
util_getenv (&escape, "escape", Mail_env_string, 0); |
166 |
util_error ("%c%s requires an argument", escape[0], argv[0]); |
util_error (_("%c%s requires an argument"), escape[0], argv[0]); |
167 |
return 1; |
return 1; |
168 |
} |
} |
169 |
return 0; |
return 0; |
195 |
entry = util_find_entry (mail_command_table, argv[1]); |
entry = util_find_entry (mail_command_table, argv[1]); |
196 |
if (!entry.func) |
if (!entry.func) |
197 |
{ |
{ |
198 |
util_error ("Unknown command: %s", argv[1]); |
util_error (_("Unknown command: %s"), argv[1]); |
199 |
return 1; |
return 1; |
200 |
} |
} |
201 |
if (entry.flags & (EF_FLOW | EF_SEND)) |
if (entry.flags & (EF_FLOW | EF_SEND)) |
202 |
{ |
{ |
203 |
util_error ("Command not allowed in an escape sequence\n"); |
util_error (_("Command not allowed in an escape sequence\n")); |
204 |
return 1; |
return 1; |
205 |
} |
} |
206 |
|
|
251 |
|
|
252 |
if (!fp) |
if (!fp) |
253 |
{ |
{ |
254 |
util_error ("can't open %s: %s", name, strerror (errno)); |
util_error (_("can't open %s: %s"), name, strerror (errno)); |
255 |
free (name); |
free (name); |
256 |
} |
} |
257 |
|
|
258 |
fprintf (stdout, "Reading %s\n", name); |
fprintf (stdout, _("Reading %s\n"), name); |
259 |
while (getline (&buf, &n, fp) > 0) |
while (getline (&buf, &n, fp) > 0) |
260 |
fprintf (ofile, "%s", buf); |
fprintf (ofile, "%s", buf); |
261 |
|
|
455 |
if (util_get_message (mbox, cursor, &mesg, MSG_NODELETED)) |
if (util_get_message (mbox, cursor, &mesg, MSG_NODELETED)) |
456 |
return 1; |
return 1; |
457 |
|
|
458 |
fprintf (stdout, "Interpolating: %d\n", cursor); |
fprintf (stdout, _("Interpolating: %d\n"), cursor); |
459 |
|
|
460 |
util_getenv (&prefix, "indentprefix", Mail_env_string, 0); |
util_getenv (&prefix, "indentprefix", Mail_env_string, 0); |
461 |
|
|
516 |
{ |
{ |
517 |
char buffer[512]; |
char buffer[512]; |
518 |
|
|
519 |
fprintf (env->ofile, "Message contains:\n"); |
fprintf (env->ofile, _("Message contains:\n")); |
520 |
|
|
521 |
dump_headers (env->ofile, env); |
dump_headers (env->ofile, env); |
522 |
|
|
546 |
inf = fopen (filename, "r"); |
inf = fopen (filename, "r"); |
547 |
if (!inf) |
if (!inf) |
548 |
{ |
{ |
549 |
util_error ("can't open %s: %s\n", filename, strerror (errno)); |
util_error (_("can't open %s: %s\n"), filename, strerror (errno)); |
550 |
free (filename); |
free (filename); |
551 |
return 1; |
return 1; |
552 |
} |
} |
601 |
|
|
602 |
if (!fp) |
if (!fp) |
603 |
{ |
{ |
604 |
util_error ("can't open %s: %s\n", filename, strerror (errno)); |
util_error (_("can't open %s: %s\n"), filename, strerror (errno)); |
605 |
free (filename); |
free (filename); |
606 |
return 1; |
return 1; |
607 |
} |
} |
631 |
|
|
632 |
if (argc == 1) |
if (argc == 1) |
633 |
{ |
{ |
634 |
util_error ("pipe: no command specified"); |
util_error (_("pipe: no command specified")); |
635 |
return 1; |
return 1; |
636 |
} |
} |
637 |
|
|
675 |
xargv[i] = argv[i + 1]; |
xargv[i] = argv[i + 1]; |
676 |
xargv[i] = NULL; |
xargv[i] = NULL; |
677 |
execvp (xargv[0], xargv); |
execvp (xargv[0], xargv); |
678 |
util_error ("cannot exec process `%s': %s", xargv[0], strerror (errno)); |
util_error (_("cannot exec process `%s': %s"), xargv[0], strerror (errno)); |
679 |
exit (1); |
exit (1); |
680 |
} |
} |
681 |
else |
else |
708 |
waitpid (pid, &status, 0); |
waitpid (pid, &status, 0); |
709 |
if (!WIFEXITED (status)) |
if (!WIFEXITED (status)) |
710 |
{ |
{ |
711 |
util_error ("child terminated abnormally: %d", WEXITSTATUS (status)); |
util_error (_("child terminated abnormally: %d"), WEXITSTATUS (status)); |
712 |
} |
} |
713 |
else |
else |
714 |
{ |
{ |
715 |
struct stat st; |
struct stat st; |
716 |
if (fstat (fd, &st)) |
if (fstat (fd, &st)) |
717 |
{ |
{ |
718 |
util_error ("can't stat output file: %s", strerror (errno)); |
util_error (_("can't stat output file: %s"), strerror (errno)); |
719 |
} |
} |
720 |
else if (st.st_size > 0) |
else if (st.st_size > 0) |
721 |
rc = 0; |
rc = 0; |
725 |
(unsigned long) lines, (unsigned long) size); |
(unsigned long) lines, (unsigned long) size); |
726 |
if (rc) |
if (rc) |
727 |
{ |
{ |
728 |
fprintf (stdout, "no lines out\n"); |
fprintf (stdout, _("no lines out\n")); |
729 |
} |
} |
730 |
else |
else |
731 |
{ |
{ |