- }
-
- if (file) {
- /*
- * We are replying to a file.
- */
- anot = 0; /* we don't want to annotate a file */
- } else {
- /*
- * We are replying to a message.
- */
- if (!msg)
- msg = "cur";
- if (!folder)
- folder = getfolder (1);
- maildir = m_maildir (folder);
-
- if (chdir (maildir) == NOTOK)
- adios (maildir, "unable to change directory to");
-
- /* read folder and create message structure */
- if (!(mp = folder_read (folder)))
- adios (NULL, "unable to read folder %s", folder);
-
- /* check for empty folder */
- if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
-
- /* parse the message range/sequence/name and set SELECTED */
- if (!m_convert (mp, msg))
- done (1);
- seq_setprev (mp); /* set the previous-sequence */
-
- if (mp->numsel > 1)
- adios (NULL, "only one message at a time!");
-
- context_replace (pfolder, folder); /* update current folder */
- seq_setcur (mp, mp->lowsel); /* update current message */
- seq_save (mp); /* synchronize sequences */
- context_save (); /* save the context file */
- }
-
- msg = file ? file : getcpy (m_name (mp->lowsel));
-
- if ((in = fopen (msg, "r")) == NULL)
- adios (msg, "unable to open");
-
- /* find form (components) file */
- if (!form) {
- if (groupreply)
- form = etcpath (replgroupcomps);
- else
- form = etcpath (replcomps);
- }
-
- replout (in, msg, drft, mp, outputlinelen, mime, form, filter, fcc);
- fclose (in);
-
- if (nwhat)
- done (0);
- what_now (ed, nedit, NOUSE, drft, msg, 0, mp,
- anot ? "Replied" : NULL, inplace, cwd);
- done (1);
+
+ msg = file ? file : getcpy(m_name(mp->lowsel));
+
+ if ((in = fopen(msg, "r")) == NULL)
+ adios(msg, "unable to open");
+
+ /* find form (components) file */
+ if (!form) {
+ if (groupreply)
+ form = etcpath(replgroupcomps);
+ else
+ form = etcpath(replcomps);
+ }
+
+ replout(in, msg, drft, mp, outputlinelen, mime, form, filter, fcc);
+ fclose(in);
+
+ if (nwhat)
+ done(0);
+ what_now(ed, nedit, NOUSE, drft, msg, 0, mp, anot ? "Replied" : NULL,
+ inplace, cwd);
+ done(1);
+ return 1;