From b5c4a2721d7b4bd54705c53e6f294ab2ef66a6f7 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 17 Nov 2017 17:25:58 +0100 Subject: w32: Add new API fucntion gpgrt_w32_reg_query_string. * src/w32-reg.c: New. * src/w32-add.h: Add gpgrt_w32_reg_query_string. * src/visibility.c (gpgrt_w32_reg_query_string): New wrapper. * src/gpg-error.def.in: Add gpgrt_w32_reg_query_string. * configure.ac (ac_check_funcs): Add stpcpy. * src/Makefile.am (arch_sources): Add w32-reg.c (socklibs): New. (libgpg_error_la_LIBADD): Add socklibs. * src/gpgrt-int.h (xfree, xtrymalloc, xtrycalloc) (xtryrealloc): New internal macros. (_gpgrt_stpcpy, stpcpy): New replacement fucntion and macro. * src/logging.c (_gpgrt_logv_internal): Use new registry query function and add standard registry key. -- This also fixes the build failure on Widnwos for logging.c. The code for gpgrt_w32_reg_query_string has been taken from the function read_w32_registry_string in w32-utils.c in the GPGME package. Signed-off-by: Werner Koch --- src/logging.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/logging.c') diff --git a/src/logging.c b/src/logging.c index 2e675f5..dbd8066 100644 --- a/src/logging.c +++ b/src/logging.c @@ -787,9 +787,9 @@ _gpgrt_logv_internal (int level, int ignore_arg_ptr, const char *extrastring, tmp = (no_registry ? NULL - : read_w32_registry_string (NULL, GNUPG_REGISTRY_DIR, - "DefaultLogFile")); - log_set_file (tmp && *tmp? tmp : NULL); + : _gpgrt_w32_reg_query_string (NULL, "Software\\\\GNU\\\\GnuPG", + "DefaultLogFile")); + _gpgrt_log_set_sink (tmp && *tmp? tmp : NULL, NULL, -1); _gpgrt_free (tmp); #else /* Make sure a log stream has been set. */ @@ -1119,7 +1119,7 @@ _gpgrt_logv_printhex (const void *buffer, size_t length, cnt = 0; /* (we indicate continuations with a backslash) */ _gpgrt_log_printf (" \\\n"); - _gpgrt_log_debug (""); + _gpgrt_log_debug ("%s", ""); if (fmt && *fmt) _gpgrt_log_printf (" "); } -- cgit v1.2.3