[Pkg-gnupg-commit] [gnupg2] 77/292: tests, w32: Do not expose 'glob' to gpgscm.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Nov 21 06:31:28 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit 41b510f9c510f8fd1b59eb0c5dd2e2b2deaf0a1b
Author: Justus Winter <justus at g10code.com>
Date:   Tue Oct 4 12:59:18 2016 +0200

    tests,w32: Do not expose 'glob' to gpgscm.
    
    * tests/gpgscm/ffi.c (do_glob): Remove function.
    (ffi_init): Likewise.
    --
    'glob' is not available on mingw, and portability is the whole point
    of gpgscm.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 tests/gpgscm/ffi.c | 38 --------------------------------------
 1 file changed, 38 deletions(-)

diff --git a/tests/gpgscm/ffi.c b/tests/gpgscm/ffi.c
index 4559f10..829384a 100644
--- a/tests/gpgscm/ffi.c
+++ b/tests/gpgscm/ffi.c
@@ -25,7 +25,6 @@
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <glob.h>
 #include <gpg-error.h>
 #include <stdarg.h>
 #include <stdlib.h>
@@ -1025,42 +1024,6 @@ do_string_contains (scheme *sc, pointer args)
   FFI_RETURN_POINTER (sc, strstr (haystack, needle) ? sc->T : sc->F);
 }
 
-static pointer
-do_glob (scheme *sc, pointer args)
-{
-  FFI_PROLOG ();
-  pointer result = sc->NIL;
-  size_t i;
-  char *pattern;
-  glob_t pglob;
-  FFI_ARG_OR_RETURN (sc, char *, pattern, string, args);
-  FFI_ARGS_DONE_OR_RETURN (sc, args);
-
-  switch (glob (pattern, 0, NULL, &pglob))
-    {
-    case 0:
-      for (i = 0; i < pglob.gl_pathc; i++)
-        result =
-          (sc->vptr->cons) (sc,
-                            sc->vptr->mk_string (sc, pglob.gl_pathv[i]),
-                            result);
-      globfree (&pglob);
-      break;
-
-    case GLOB_NOMATCH:
-      /* Return the empty list.  */
-      break;
-
-    case GLOB_NOSPACE:
-      return ffi_sprintf (sc, "out of memory");
-    case GLOB_ABORTED:
-      return ffi_sprintf (sc, "read error");
-    default:
-      assert (! "not reached");
-    }
-  FFI_RETURN_POINTER (sc, result);
-}
-
 

 
 static pointer
@@ -1289,7 +1252,6 @@ ffi_init (scheme *sc, const char *argv0, const char *scriptname,
   ffi_define_function (sc, string_index);
   ffi_define_function (sc, string_rindex);
   ffi_define_function_name (sc, "string-contains?", string_contains);
-  ffi_define_function (sc, glob);
 
   /* User interface.  */
   ffi_define_function (sc, flush_stdio);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list