diff options
author | Werner Koch <[email protected]> | 2007-06-19 09:11:11 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2007-06-19 09:11:11 +0000 |
commit | 540f9164c01dbbd1f8fc9abcd2ee67dbf6e1ee10 (patch) | |
tree | 298058ec8adf7c7c059ce7db127334a9ddb49bec /tools/gpgconf-comp.c | |
parent | jnlib/ (diff) | |
download | gnupg-540f9164c01dbbd1f8fc9abcd2ee67dbf6e1ee10.tar.gz gnupg-540f9164c01dbbd1f8fc9abcd2ee67dbf6e1ee10.zip |
Made percent_escape more general.
Added regression tests support to jnlib.
W32 changes.
Diffstat (limited to 'tools/gpgconf-comp.c')
-rw-r--r-- | tools/gpgconf-comp.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index 368d4988d..caf09d342 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -984,7 +984,7 @@ my_dgettext (const char *domain, const char *msgid) /* Percent-Escape special characters. The string is valid until the next invocation of the function. */ static char * -percent_escape (const char *src) +my_percent_escape (const char *src) { static char *esc_str; static int esc_str_len; @@ -1083,7 +1083,8 @@ gc_component_list_components (FILE *out) { const char *desc = gc_component[idx].desc; desc = my_dgettext (gc_component[idx].desc_domain, desc); - fprintf (out, "%s:%s\n", gc_component[idx].name, percent_escape (desc)); + fprintf (out, "%s:%s\n", + gc_component[idx].name, my_percent_escape (desc)); } } @@ -1174,7 +1175,7 @@ list_one_option (const gc_option_t *option, FILE *out) fprintf (out, " %s", gc_level[option->level].name); /* The description field. */ - fprintf (out, ":%s", desc ? percent_escape (desc) : ""); + fprintf (out, ":%s", desc ? my_percent_escape (desc) : ""); /* The type field. */ fprintf (out, ":%u", option->arg_type); @@ -1188,7 +1189,7 @@ list_one_option (const gc_option_t *option, FILE *out) gc_arg_type[gc_arg_type[option->arg_type].fallback].name); /* The argument name field. */ - fprintf (out, ":%s", arg_name ? percent_escape (arg_name) : ""); + fprintf (out, ":%s", arg_name ? my_percent_escape (arg_name) : ""); if (arg_name) xfree (arg_name); @@ -1458,7 +1459,7 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend) } else if (gc_arg_type[option->arg_type].fallback == GC_ARG_TYPE_STRING) - opt_value = xasprintf ("\"%s", percent_escape (value)); + opt_value = xasprintf ("\"%s", my_percent_escape (value)); else { /* FIXME: Verify that the number is sane. */ @@ -1549,12 +1550,12 @@ retrieve_options_from_file (gc_component_t component, gc_backend_t backend) really append. */ if (list) { - new_list = xasprintf ("%s,\"%s", list, percent_escape (start)); + new_list = xasprintf ("%s,\"%s", list, my_percent_escape (start)); xfree (list); list = new_list; } else - list = xasprintf ("\"%s", percent_escape (start)); + list = xasprintf ("\"%s", my_percent_escape (start)); } if (length < 0 || ferror (list_file)) gc_error (1, errno, "can not read list file %s", list_pathname); |