diff options
| author | Werner Koch <[email protected]> | 2025-10-27 11:43:27 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2025-10-27 11:43:27 +0000 |
| commit | ad0c6c33c3d6fe7ff7cc8c2e73d02ead5788e5b3 (patch) | |
| tree | 8c2692e19486d7ceab3261a660725ea2a235d4e8 /g10/openfile.c | |
| parent | gpg: Improve/relax the checking of preference options. (diff) | |
| download | gnupg-ad0c6c33c3d6fe7ff7cc8c2e73d02ead5788e5b3.tar.gz gnupg-ad0c6c33c3d6fe7ff7cc8c2e73d02ead5788e5b3.zip | |
gpg: Do not use a default when asking for another output filename.
* g10/options.h (COMPAT_SUGGEST_EMBEDDED_NAME): New.
* g10/gpg.c (compatibility_flags): New flags "suggest-embedded-name".
* g10/openfile.c (ask_outfile_name): Do not show a default unless the
compatibiliy flag is used.
Diffstat (limited to 'g10/openfile.c')
| -rw-r--r-- | g10/openfile.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/g10/openfile.c b/g10/openfile.c index 42d470889..04545ea75 100644 --- a/g10/openfile.c +++ b/g10/openfile.c @@ -125,7 +125,7 @@ make_outfile_name (const char *iname) NAMELEN is its actual length. */ char * -ask_outfile_name( const char *name, size_t namelen ) +ask_outfile_name (const char *name, size_t namelen) { size_t n; const char *s; @@ -136,8 +136,14 @@ ask_outfile_name( const char *name, size_t namelen ) if ( opt.batch ) return NULL; - defname = name && namelen? make_printable_string (name, namelen, 0) : NULL; - + /* To avoid tricking the user into using the embedded filename we do + * not anymore include that name in the prompt as default. For + * modern v5 signature this might make sense as they are now covered + * by the signature but we better leave such a decision to a GUI. */ + if (name && namelen && (opt.compat_flags & COMPAT_SUGGEST_EMBEDDED_NAME)) + defname = make_printable_string (name, namelen, 0); + else + defname = NULL; s = _("Enter new filename"); n = strlen(s) + (defname?strlen (defname):0) + 10; prompt = xmalloc (n); |
