X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mx%2Fcompress.c;h=6e988caa7148d64683cb0a8654218b36d634d2db;hp=9e44f340c65de5f2497814921aa3d81d442538a9;hb=262e2af383382c02b8a3dda72168f6505ddae15f;hpb=fbb5e4651a646bb9556c43f26eca110a42274105 diff --git a/lib-mx/compress.c b/lib-mx/compress.c index 9e44f34..6e988ca 100644 --- a/lib-mx/compress.c +++ b/lib-mx/compress.c @@ -174,7 +174,7 @@ int mutt_check_mailbox_compressed (CONTEXT * ctx) return 0; } -int mutt_open_read_compressed (CONTEXT * ctx) +int mutt_open_read_compressed(CONTEXT * ctx) { char *cmd; FILE *fp; @@ -196,17 +196,16 @@ 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(MCore.tmpdir), NULL); /* If we cannot open tempfile, that means the file already exists (!?) * or we are following a symlink, which is bad and insecure. */ - if(!tmpfd) { + if(tmpfd < 0) { return -1; } close(tmpfd); - - ctx->path = p_dupstr(tmppath, m_strlen(tmppath)); + ctx->path = p_dupstr(tmppath, m_strlen(tmppath)); ctx->cinfo->size = get_size(ctx->realpath); if (!ctx->quiet) @@ -279,7 +278,7 @@ int mutt_open_append_compressed (CONTEXT * ctx) if (!get_append_command (ctx->path, ctx)) { if (ci->open && ci->close) - return mutt_open_read_compressed (ctx); + return mutt_open_read_compressed(ctx); ctx->magic = 0; p_delete(&ctx->cinfo); @@ -290,7 +289,7 @@ 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(MCore.tmpdir), NULL); m_fclose(&fh); ctx->path = p_dupstr(tmppath, m_strlen(tmppath));