* mutt_free_compress_info - Frees the compress info members and structure.
* @ctx: Mailbox to free compress_info for.
*/
-void
+static void
mutt_free_compress_info (CONTEXT *ctx)
{
COMPRESS_INFO *ci;
struct mx_ops *ops = ci->child_ops;
if (!ops)
+ {
+ mutt_free_compress_info (ctx);
return -1;
+ }
ops->close (ctx);
{
remove (ctx->path);
}
-
- return 0;
- }
-
- const char *append;
- const char *msg;
-
- /* The file exists and we can append */
- if ((access (ctx->realpath, F_OK) == 0) && ci->append)
- {
- append = ci->append;
- msg = _("Compressed-appending to %s...");
}
else
{
- append = ci->close;
- msg = _("Compressing %s...");
- }
+ const char *append;
+ const char *msg;
- int rc = execute_command (ctx, append, msg);
- if (rc == 0)
- {
- mutt_any_key_to_continue (NULL);
- mutt_error (_("Error. Preserving temporary file: %s"), ctx->path);
+ /* The file exists and we can append */
+ if ((access (ctx->realpath, F_OK) == 0) && ci->append)
+ {
+ append = ci->append;
+ msg = _("Compressed-appending to %s...");
+ }
+ else
+ {
+ append = ci->close;
+ msg = _("Compressing %s...");
+ }
+
+ int rc = execute_command (ctx, append, msg);
+ if (rc == 0)
+ {
+ mutt_any_key_to_continue (NULL);
+ mutt_error (_("Error. Preserving temporary file: %s"), ctx->path);
+ }
+ else
+ remove (ctx->path);
+
+ unlock_realpath (ctx);
}
- else
- remove (ctx->path);
- unlock_realpath (ctx);
+ mutt_free_compress_info (ctx);
return 0;
}
#ifndef _COMPRESS_H_
#define _COMPRESS_H_
-void mutt_free_compress_info (CONTEXT *ctx);
-
int mutt_comp_can_append (CONTEXT *ctx);
int mutt_comp_can_read (const char *path);
int mutt_comp_valid_command (const char *cmd);
if (ctx->mx_ops)
ctx->mx_ops->close (ctx);
-#ifdef USE_COMPRESSED
- mutt_free_compress_info (ctx);
-#endif /* USE_COMPRESSED */
-
if (ctx->subj_hash)
hash_destroy (&ctx->subj_hash, NULL);
if (ctx->id_hash)