1 |
/* GNU Mailutils -- a suite of utilities for electronic mail |
/* GNU Mailutils -- a suite of utilities for electronic mail |
2 |
Copyright (C) 2002 Free Software Foundation, Inc. |
Copyright (C) 2002,2003 Free Software Foundation, Inc. |
3 |
|
|
4 |
GNU Mailutils 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 |
98 |
"%<(nonnull)%(void(width))%(putaddr cc: )\\n%>" |
"%<(nonnull)%(void(width))%(putaddr cc: )\\n%>" |
99 |
"%<{fcc}Fcc: %{fcc}\\n%>" |
"%<{fcc}Fcc: %{fcc}\\n%>" |
100 |
"%<{subject}Subject: Re: %(unre{subject})\\n%>" |
"%<{subject}Subject: Re: %(unre{subject})\\n%>" |
101 |
"%(lit)%(concat(in_reply_to))%<(nonnull)%(void(width))%(printstr In-reply-to: )\\n%>" |
"%(lit)%(concat(in_reply_to))%<(nonnull)%(void(width))%(printhdr In-reply-to: )\\n%>" |
102 |
"%(lit)%(concat(references))%<(nonnull)%(void(width))%(printstr References: )\\n%>" |
"%(lit)%(concat(references))%<(nonnull)%(void(width))%(printhdr References: )\\n%>" |
103 |
"X-Mailer: MH \\(%(package_string)\\)\\n" |
"X-Mailer: MH \\(%(package_string)\\)\\n" |
104 |
"--------\n"; |
"--------\n"; |
105 |
|
|
216 |
struct stat st; |
struct stat st; |
217 |
|
|
218 |
/* First check if the draft exists */ |
/* First check if the draft exists */ |
219 |
if (stat (wh->draftfile, &st) == 0) |
if (!build_only && stat (wh->draftfile, &st) == 0) |
220 |
{ |
{ |
221 |
if (use_draft) |
if (use_draft) |
222 |
disp = DISP_USE; |
disp = DISP_USE; |
223 |
else |
else |
224 |
{ |
{ |
225 |
printf (ngettext ("Draft \"%s\" exists (%lu byte).\n", |
printf (ngettext ("Draft \"%s\" exists (%lu byte).\n", |
226 |
"Draft \"%s\" exists (%lu bytes).\n", |
"Draft \"%s\" exists (%lu bytes).\n", |
258 |
if (disp == DISP_REPLACE) |
if (disp == DISP_REPLACE) |
259 |
{ |
{ |
260 |
FILE *fp = fopen (wh->file, "w+"); |
FILE *fp = fopen (wh->file, "w+"); |
261 |
char buffer[1024]; |
char *buf = NULL; |
|
#define bufsize sizeof(buffer) |
|
262 |
|
|
263 |
if (!fp) |
if (!fp) |
264 |
{ |
{ |
266 |
wh->file, strerror (errno)); |
wh->file, strerror (errno)); |
267 |
exit (1); |
exit (1); |
268 |
} |
} |
269 |
mh_format (&format, msg, msgset.list[0], buffer, bufsize); |
mh_format (&format, msg, msgset.list[0], width, &buf); |
270 |
fprintf (fp, "%s", buffer); |
fprintf (fp, "%s", buf); |
271 |
fclose (fp); |
fclose (fp); |
272 |
|
free (buf); |
273 |
} |
} |
274 |
|
|
275 |
{ |
{ |