X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mx%2Fcompress.c;h=c28eee69edc33da00a0e8e11b47e7840fe255cb7;hp=df6c761078c970ae313d9d52b6ca1b30c71a73b9;hb=9946738a6a1c27a5602a14d1afe2eea2389732b2;hpb=18ebc21bf1d29ed07fa007329879493493e18eb3 diff --git a/lib-mx/compress.c b/lib-mx/compress.c index df6c761..c28eee6 100644 --- a/lib-mx/compress.c +++ b/lib-mx/compress.c @@ -196,7 +196,7 @@ int mutt_open_read_compressed(CONTEXT * ctx) ctx->realpath = ctx->path; /* Uncompress to /tmp */ - tmpfd = m_tempfd(tmppath, sizeof(tmppath), NONULL(Tempdir), NULL); + tmpfd = m_tempfd(tmppath, sizeof(tmppath), NONULL(mod_core.tmpdir), NULL); /* If we cannot open tempfile, that means the file already exists (!?) * or we are following a symlink, which is bad and insecure. */ @@ -266,7 +266,7 @@ static void restore_path (CONTEXT * ctx) /* remove the temporary mailbox */ static void remove_file (CONTEXT * ctx) { - if (ctx->magic == M_MBOX || ctx->magic == M_MMDF) + if (ctx->magic == M_MBOX) remove (ctx->path); } @@ -289,20 +289,17 @@ int mutt_open_append_compressed (CONTEXT * ctx) ctx->realpath = ctx->path; /* Uncompress to /tmp */ - fh = m_tempfile(tmppath, sizeof(tmppath), NONULL(Tempdir), NULL); + fh = m_tempfile(tmppath, sizeof(tmppath), NONULL(mod_core.tmpdir), NULL); m_fclose(&fh); ctx->path = p_dupstr(tmppath, m_strlen(tmppath)); ctx->magic = DefaultMagic; - if (is_new (ctx->realpath) || - (ctx->magic != M_MBOX && - ctx->magic != M_MMDF)) + if (is_new (ctx->realpath) || ctx->magic != M_MBOX) unlink(tmppath); /* No error checking - the parent function will catch it */ - return 0; } @@ -313,11 +310,7 @@ void mutt_fast_close_compressed (CONTEXT * ctx) m_fclose(&ctx->fp); /* if the folder was removed, remove the gzipped folder too */ - if (access (ctx->path, F_OK) != 0 && !option (OPTSAVEEMPTY)) - remove (ctx->realpath); - else - remove_file (ctx); - + remove_file (ctx); restore_path (ctx); p_delete(&ctx->cinfo); }