common: Minor fixes for the new private-keys.c.
* common/private-keys.c (my_error_from_syserror): New. Use it in place of gpg_error_from_syserror. (_pkc_add, pkc_lookup, pke_next_value): Use ascii_strcasecmp. (pkc_parse): Use xtrystrdup and append_to_strlist_try as intended. (_pkc_add): Add braces around if-statement.
We should have a macro so that we do not need to define a wrapper
function like my_error_from_syserror in files where it is needed. I
am not sure about a proper name, "my_" seems to be the easiest
replacement. Note that the global DEFAULT_ERRSOURCE is relatively new
to replace the need to convey the error source in function calls; we
want that function from common/ return the error source of the main
binary.
We require that a key is ASCII and thus we better use ascii_strcasecmp
to avoid problems with strange locales.
- Signed-off-by: Werner Koch <wk@gnupg.org>