[git] GPGME - branch, master, updated. gpgme-1.11.1-63-gd8beab3

[email protected] (by Andre Heinecke)
Newsgroups gmane.comp.encryption.gpg.cvs
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  d8beab30c44482fb7a3e445b92cec482792b2ca0 (commit)
      from  19c5267f868aa41e73752ac1c76ec7ae1efe07b8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d8beab30c44482fb7a3e445b92cec482792b2ca0
Author: Andre Heinecke <[email protected]>
Date:   Wed Jun 20 09:43:19 2018 +0200

    json: Add file handling for debug output
    
    * src/gpgme-json.c (main): Add possibilty to set log file.
    
    --
    This is similar to how GPGME_DEBUG works. It takes ; on
    Windows as seperator and : on linux. Followed by a file name.
    
    For Linux it might make sense to use a different seperator
    to allow setting a socket explicitly. But this is better
    in line with the current GPGME_DEBUG behavior.
    
    The change helps on Windows where we don't have a
    log socket.

diff --git a/src/gpgme-json.c b/src/gpgme-json.c
index ae878bd..d7e1cbc 100644
--- a/src/gpgme-json.c
+++ b/src/gpgme-json.c
@@ -3617,6 +3617,8 @@ main (int argc, char *argv[])
   };
   gpgrt_argparse_t pargs = { &argc, &argv};
 
+  int log_file_set = 0;
+
   gpgrt_set_strusage (my_strusage);
 
 #ifdef HAVE_SETLOCALE
@@ -3653,12 +3655,24 @@ main (int argc, char *argv[])
 
   if (!opt_debug)
     {
+      /* Handling is similar to GPGME_DEBUG */
       const char *s = getenv ("GPGME_JSON_DEBUG");
+      const char *s1;
+
       if (s && atoi (s) > 0)
-        opt_debug = 1;
+        {
+          opt_debug = 1;
+          s1 = strchr (s, PATHSEP_C);
+          if (s1 && strlen (s1) > 2)
+            {
+              s1++;
+              log_set_file (s1);
+              log_file_set = 1;
+            }
+        }
     }
 
-  if (opt_debug)
+  if (opt_debug && !log_file_set)
     {
       const char *home = getenv ("HOME");
       char *file = xstrconcat ("socket://",

-----------------------------------------------------------------------

Summary of changes:
 src/gpgme-json.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.