From 41b510f9c510f8fd1b59eb0c5dd2e2b2deaf0a1b Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 4 Oct 2016 12:59:18 +0200 Subject: 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 --- tests/gpgscm/ffi.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/tests/gpgscm/ffi.c b/tests/gpgscm/ffi.c index 4559f10ec..829384ae1 100644 --- a/tests/gpgscm/ffi.c +++ b/tests/gpgscm/ffi.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -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); -- cgit v1.2.3