parser: accept trailing comma in enums; __restrict for arrays
[m6w6/ext-psi] / psi.d / glob.psi
index 5e6d21534d452d34c36304878dfb533dbd06f16c..1fd6b15c9bb6f8677a96c232acb0802877ee50f1 100644 (file)
@@ -1,3 +1,5 @@
+#include <glob.h>
+
 function psi\glob(string $pattern, int $flags, array &$glob = NULL, callable $errfn = NULL) : int {
        let path = strval($pattern);
        let flags = intval($flags);
@@ -14,7 +16,7 @@ function psi\glob(string $pattern, int $flags, array &$glob = NULL, callable $er
                        strval($gl_pathv)
                )
        );
-       return to_int(glob);
+       return glob(path, flags, err, buf) as to_int(glob);
        set $glob = to_array(*buf,
                to_int(gl_matchc),
                to_int(gl_pathc),