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.
This commit is contained in:
Marcus Brinkmann 2008-01-17 22:42:58 +00:00
parent a8fb3559b1
commit 568cc4585a
2 changed files with 17 additions and 1 deletions

View File

@ -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

View File

@ -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;