From 568cc4585a09182e556194d8b76702d54addf617 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 17 Jan 2008 22:42:58 +0000 Subject: [PATCH] 2008-01-17 Marcus Brinkmann * gpgconf-comp.c (change_options_program): Strip duplicated utf8-strings entries for gnupg backend. Don't create them either. --- tools/ChangeLog | 5 +++++ tools/gpgconf-comp.c | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/ChangeLog b/tools/ChangeLog index 460da71c8..ec31d3b37 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -1,3 +1,8 @@ +2008-01-17 Marcus Brinkmann + + * gpgconf-comp.c (change_options_program): Strip duplicated + utf8-strings entries for gnupg backend. Don't create them either. + 2007-12-10 Marcus Brinkmann * gpgconf-comp.c (gc_component_list_options): Fix up expert level diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index d004c4d45..4cd38b54a 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -2467,6 +2467,8 @@ change_options_program (gc_component_t component, gc_backend_t backend, char *src_filename; char *dest_filename; char *orig_filename; + /* Special hack for gpg, see below. */ + int utf8strings_seen = 0; /* FIXME. Throughout the function, do better error reporting. */ dest_filename = xstrdup (get_config_pathname (component, backend)); @@ -2526,6 +2528,15 @@ change_options_program (gc_component_t component, gc_backend_t backend, else break; } + else if (backend == GC_BACKEND_GPG && in_marker + && ! strcmp ("utf8-strings\n", line)) + { + /* Strip duplicated entries. */ + if (utf8strings_seen) + disable = 1; + else + utf8strings_seen = 1; + } start = line; while (*start == ' ' || *start == '\t') @@ -2591,7 +2602,7 @@ change_options_program (gc_component_t component, gc_backend_t backend, followed by the rest of the original file. */ /* We have to turn on UTF8 strings for GnuPG. */ - if (backend == GC_BACKEND_GPG) + if (backend == GC_BACKEND_GPG && ! utf8strings_seen) fprintf (src_file, "utf8-strings\n"); option = gc_component[component].options;