summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcus Brinkmann <mb@g10code.com>2008-01-17 23:42:58 +0100
committerMarcus Brinkmann <mb@g10code.com>2008-01-17 23:42:58 +0100
commit568cc4585a09182e556194d8b76702d54addf617 (patch)
tree74f3ddfccdf874ce489fe580370c32ff41017197 /tools
parent2008-01-15 Marcus Brinkmann <marcus@g10code.de> (diff)
downloadgnupg2-568cc4585a09182e556194d8b76702d54addf617.tar.xz
gnupg2-568cc4585a09182e556194d8b76702d54addf617.zip
2008-01-17 Marcus Brinkmann <marcus@g10code.de>
* gpgconf-comp.c (change_options_program): Strip duplicated utf8-strings entries for gnupg backend. Don't create them either.
Diffstat (limited to 'tools')
-rw-r--r--tools/ChangeLog5
-rw-r--r--tools/gpgconf-comp.c13
2 files changed, 17 insertions, 1 deletions
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 <marcus@g10code.de>
+
+ * gpgconf-comp.c (change_options_program): Strip duplicated
+ utf8-strings entries for gnupg backend. Don't create them either.
+
2007-12-10 Marcus Brinkmann <marcus@g10code.de>
* 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;