aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpgconf-comp.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gpgconf-comp.c')
-rw-r--r--tools/gpgconf-comp.c13
1 files changed, 12 insertions, 1 deletions
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;