aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/decrypt.c7
-rw-r--r--g10/options.h2
-rw-r--r--g10/plaintext.c3
3 files changed, 8 insertions, 4 deletions
diff --git a/g10/decrypt.c b/g10/decrypt.c
index 4d6734d40..9589aff58 100644
--- a/g10/decrypt.c
+++ b/g10/decrypt.c
@@ -48,7 +48,6 @@ decrypt_message (ctrl_t ctrl, const char *filename)
armor_filter_context_t *afx = NULL;
progress_filter_context_t *pfx;
int rc;
- int no_out = 0;
pfx = new_progress_context ();
@@ -82,11 +81,13 @@ decrypt_message (ctrl_t ctrl, const char *filename)
if (!opt.outfile)
{
- no_out = 1;
opt.outfile = "-";
+ opt.flags.dummy_outfile = 1;
}
+ else
+ opt.flags.dummy_outfile = 0;
rc = proc_encryption_packets (ctrl, NULL, fp );
- if (no_out)
+ if (opt.flags.dummy_outfile)
opt.outfile = NULL;
iobuf_close (fp);
diff --git a/g10/options.h b/g10/options.h
index 8adf09f08..b26cea0db 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -249,6 +249,8 @@ struct
unsigned int disable_signer_uid:1;
/* Flag to enable experimental features from RFC4880bis. */
unsigned int rfc4880bis:1;
+ /* Hack: --output is not given but OUTFILE was temporary set to "-". */
+ unsigned int dummy_outfile:1;
} flags;
/* Linked list of ways to find a key if the key isn't on the local
diff --git a/g10/plaintext.c b/g10/plaintext.c
index c5d1ddb7f..f9e0a4296 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -70,7 +70,8 @@ get_output_file (const byte *embedded_name, int embedded_namelen,
goto leave;
}
}
- else if (opt.outfile)
+ else if (opt.outfile
+ && !(opt.flags.use_embedded_filename && opt.flags.dummy_outfile))
{
fname = xtrystrdup (opt.outfile);
if (!fname)