[git] GnuPG - branch, master, updated. gnupg-2.1.19-71-gd17840c

by Justus Winter cvs at cvs.gnupg.org
Tue Mar 21 15:55:39 CET 2017


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 "The GNU Privacy Guard".

The branch, master has been updated
       via  d17840c3f40111beaf97d96ad3ca52047976e221 (commit)
      from  74c1f30ad6616186f0ab9dbaf34db6c17b1e40c4 (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 d17840c3f40111beaf97d96ad3ca52047976e221
Author: Justus Winter <justus at g10code.com>
Date:   Tue Mar 21 15:52:47 2017 +0100

    tests,w32: Use GetTempPath to get the path for temporary files.
    
    * tests/gpgscm/ffi.c (do_get_temp_path): New function.
    (ffi_init): Make function available.
    * tests/gpgscm/tests.scm (mkdtemp): Use the new function.
    
    Fixes-commit: 06f1f163e96f1039304fd3cf565cf9de1ca45849
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/ffi.c b/tests/gpgscm/ffi.c
index 34e573f..3af3328 100644
--- a/tests/gpgscm/ffi.c
+++ b/tests/gpgscm/ffi.c
@@ -342,6 +342,24 @@ do_seek (scheme *sc, pointer args)
 }
 
 static pointer
+do_get_temp_path (scheme *sc, pointer args)
+{
+  FFI_PROLOG ();
+#ifdef HAVE_W32_SYSTEM
+  char buffer[MAX_PATH+1];
+#endif
+  FFI_ARGS_DONE_OR_RETURN (sc, args);
+
+#ifdef HAVE_W32_SYSTEM
+  if (GetTempPath (MAX_PATH+1, buffer) == 0)
+    FFI_RETURN_STRING (sc, "/temp");
+  FFI_RETURN_STRING (sc, buffer);
+#else
+  FFI_RETURN_STRING (sc, "/tmp");
+#endif
+}
+
+static pointer
 do_mkdtemp (scheme *sc, pointer args)
 {
   FFI_PROLOG ();
@@ -1352,6 +1370,7 @@ ffi_init (scheme *sc, const char *argv0, const char *scriptname,
   ffi_define_function (sc, fdopen);
   ffi_define_function (sc, close);
   ffi_define_function (sc, seek);
+  ffi_define_function (sc, get_temp_path);
   ffi_define_function_name (sc, "_mkdtemp", mkdtemp);
   ffi_define_function (sc, unlink);
   ffi_define_function (sc, unlink_recursively);
diff --git a/tests/gpgscm/tests.scm b/tests/gpgscm/tests.scm
index 329a31a..a4339ca 100644
--- a/tests/gpgscm/tests.scm
+++ b/tests/gpgscm/tests.scm
@@ -272,7 +272,7 @@
 (define (mkdtemp . components)
   (canonical-path (_mkdtemp (if (null? components)
 				(path-join
-				 (if *win32* (getenv "Temp") "/tmp")
+				 (get-temp-path)
 				 (string-append "gpgscm-" (get-isotime) "-"
 						(basename-suffix *scriptname* ".scm")
 						"-XXXXXX"))

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

Summary of changes:
 tests/gpgscm/ffi.c     | 19 +++++++++++++++++++
 tests/gpgscm/tests.scm |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list