/[mailutils]/mailutils/mh/repl.c
ViewVC logotype

Diff of /mailutils/mh/repl.c

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

revision 1.13 by gray, Sun Jan 26 13:47:54 2003 UTC revision 1.14 by gray, Fri Jan 31 15:01:12 2003 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) 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
# Line 98  static char *format_str = Line 98  static char *format_str =
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    
# Line 216  make_draft (mailbox_t mbox, int disp, st Line 216  make_draft (mailbox_t mbox, int disp, st
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",
# Line 258  make_draft (mailbox_t mbox, int disp, st Line 258  make_draft (mailbox_t mbox, int disp, st
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          {          {
# Line 267  make_draft (mailbox_t mbox, int disp, st Line 266  make_draft (mailbox_t mbox, int disp, st
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    {    {

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

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