raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=3faf1a4627bee26a7550b00bd5f1ff01fc34d5c3

commit 3faf1a4627bee26a7550b00bd5f1ff01fc34d5c3
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Mon May 3 20:59:27 2021 +0100

    move to eina's new fnmatch
---
 meson.build                    | 6 ------
 src/bin/e.h                    | 1 -
 src/bin/e_actions.c            | 4 ++--
 src/bin/e_fm/e_fm_ipc.c        | 1 -
 src/bin/e_fm/e_fm_main.c       | 1 -
 src/bin/e_sys_main.c           | 7 +++----
 src/bin/e_utils.c              | 4 ++--
 src/bin/meson.build            | 1 -
 src/bin/system/e_system.h      | 1 -
 src/bin/system/e_system_main.c | 8 ++++----
 src/modules/mixer/emixer.c     | 2 +-
 11 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/meson.build b/meson.build
index c82233b1a..1820bfd86 100644
--- a/meson.build
+++ b/meson.build
@@ -192,12 +192,6 @@ if cc.has_function('mlock') == true
   config_h.set('HAVE_MLOCK'            , '1')
 endif
 
-if cc.has_header('fnmatch.h') == false
-  error('fnmatch.h not found')
-endif
-
-dep_fnmatch = cc.find_library('fnmatch', required: false)
-
 code = '''#define _GNU_SOURCE 1
 #include <unistd.h>
 #include <stdio.h>
diff --git a/src/bin/e.h b/src/bin/e.h
index 62a8e61fe..4d2b4f24e 100644
--- a/src/bin/e.h
+++ b/src/bin/e.h
@@ -78,7 +78,6 @@ void *alloca (size_t);
 # include <dlfcn.h>
 # include <math.h>
 # include <fcntl.h>
-# include <fnmatch.h>
 # include <limits.h>
 # include <ctype.h>
 # include <time.h>
diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c
index 3bdc26d47..0208365ee 100644
--- a/src/bin/e_actions.c
+++ b/src/bin/e_actions.c
@@ -2718,7 +2718,7 @@ ACT_FN_GO(shelf_show, )
 
    EINA_LIST_FOREACH(e_shelf_list(), l, es)
      {
-        if ((!params) || (params && (fnmatch(params, es->name, 0) == 0)))
+        if ((!params) || (params && (eina_fnmatch(params, es->name, 0))))
           {
              e_shelf_toggle(es, 1);
              e_shelf_toggle(es, 0);
@@ -2727,7 +2727,7 @@ ACT_FN_GO(shelf_show, )
 }
 /***************************************************************************/
 #define ACT_SHELF_SHOW(params, es)                                  \
-  if ((!params) || (params && (fnmatch(params, es->name, 0) == 0))) \
+  if ((!params) || (params && (eina_fnmatch(params, es->name, 0)))) \
     {                                                               \
        e_shelf_toggle(es, 1);                                       \
        e_shelf_toggle(es, 0);                                       \
diff --git a/src/bin/e_fm/e_fm_ipc.c b/src/bin/e_fm/e_fm_ipc.c
index 917ae21f9..6d5db7c31 100644
--- a/src/bin/e_fm/e_fm_ipc.c
+++ b/src/bin/e_fm/e_fm_ipc.c
@@ -20,7 +20,6 @@
 #include <sys/param.h>
 #include <utime.h>
 #include <math.h>
-#include <fnmatch.h>
 #include <limits.h>
 #include <ctype.h>
 #include <time.h>
diff --git a/src/bin/e_fm/e_fm_main.c b/src/bin/e_fm/e_fm_main.c
index a1317d680..e85fafe62 100644
--- a/src/bin/e_fm/e_fm_main.c
+++ b/src/bin/e_fm/e_fm_main.c
@@ -32,7 +32,6 @@ void *alloca (size_t);
 #include <sys/param.h>
 #include <utime.h>
 #include <math.h>
-#include <fnmatch.h>
 #include <limits.h>
 #include <ctype.h>
 #include <time.h>
diff --git a/src/bin/e_sys_main.c b/src/bin/e_sys_main.c
index abc2c3bff..e19c1dceb 100644
--- a/src/bin/e_sys_main.c
+++ b/src/bin/e_sys_main.c
@@ -20,7 +20,6 @@
 #include <sys/wait.h>
 #include <pwd.h>
 #include <grp.h>
-#include <fnmatch.h>
 #include <ctype.h>
 #ifdef HAVE_ALLOCA_H
 #include <alloca.h>
@@ -598,7 +597,7 @@ auth_etc_enlightenment_sysactions(char *a,
         deny = 0;
         if (!strcmp(id, "user:"))
           {
-             if (!fnmatch(ugname, u, 0))
+             if (eina_fnmatch(ugname, u, 0))
                {
                   if (!strcmp(perm, "allow:")) allow = 1;
                   else if (!strcmp(perm, "deny:"))
@@ -615,7 +614,7 @@ auth_etc_enlightenment_sysactions(char *a,
 
              for (gp = g; *gp; gp++)
                {
-                  if (!fnmatch(ugname, *gp, 0))
+                  if (eina_fnmatch(ugname, *gp, 0))
                     {
                        matched = EINA_TRUE;
                        if (!strcmp(perm, "allow:")) allow = 1;
@@ -646,7 +645,7 @@ auth_etc_enlightenment_sysactions(char *a,
           {
              p = get_word(p, act);
              if (act[0] == 0) break;
-             if (!fnmatch(act, a, 0))
+             if (eina_fnmatch(act, a, 0))
                {
                   if (allow) ok = 1;
                   else if (deny)
diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c
index 8db378add..49716ebdd 100644
--- a/src/bin/e_utils.c
+++ b/src/bin/e_utils.c
@@ -62,7 +62,7 @@ e_util_glob_match(const char *str, const char *pattern)
      }
    if (str == pattern) return 1;
    if (!strcmp(pattern, "*")) return 1;
-   if (!fnmatch(pattern, str, 0)) return 1;
+   if (eina_fnmatch(pattern, str, 0)) return 1;
    return 0;
 }
 
@@ -87,7 +87,7 @@ e_util_glob_case_match(const char *str, const char *pattern)
    for (tp = tglob, p = pattern; *p != 0; p++, tp++)
      *tp = tolower(*p);
    *tp = 0;
-   if (!fnmatch(tglob, tstr, 0)) return 1;
+   if (eina_fnmatch(tglob, tstr, 0)) return 1;
    return 0;
 }
 
diff --git a/src/bin/meson.build b/src/bin/meson.build
index f4f1c315f..5d15382cb 100644
--- a/src/bin/meson.build
+++ b/src/bin/meson.build
@@ -16,7 +16,6 @@ deps_e = [
   dep_m,
   dep_dl,
   dep_execinfo,
-  dep_fnmatch,
   dep_eina,
   dep_eet,
   dep_eeze,
diff --git a/src/bin/system/e_system.h b/src/bin/system/e_system.h
index 7d8e77bfd..569699171 100644
--- a/src/bin/system/e_system.h
+++ b/src/bin/system/e_system.h
@@ -52,7 +52,6 @@ void *alloca (size_t);
 # include <dlfcn.h>
 # include <math.h>
 # include <fcntl.h>
-# include <fnmatch.h>
 # include <limits.h>
 # include <ctype.h>
 # include <time.h>
diff --git a/src/bin/system/e_system_main.c b/src/bin/system/e_system_main.c
index 23a5f6f77..111430a84 100644
--- a/src/bin/system/e_system_main.c
+++ b/src/bin/system/e_system_main.c
@@ -15,12 +15,12 @@ _conf_allow_deny(const char *cmd, const char *glob, const 
char *sys)
    if (!strcmp(cmd, "allow:"))
      {
         if (!strcmp(glob, "*")) return 1; // allow
-        if (!fnmatch(glob, sys, 0)) return 1; // allow this sys
+        if (eina_fnmatch(glob, sys, 0)) return 1; // allow this sys
      }
    else if (!strcmp(cmd, "deny:"))
      {
         if (!strcmp(glob, "*")) return -1; // deny
-        if (!fnmatch(glob, sys, 0)) return -1; // deny this sys
+        if (eina_fnmatch(glob, sys, 0)) return -1; // deny this sys
      }
    return 0; // unknown
 }
@@ -58,7 +58,7 @@ _etc_enlightenment_system_conf_check(const char *sys)
                   in_usergroup = EINA_FALSE;
                   if (pw)
                     {
-                       if (!fnmatch(usergroup, pw->pw_name, 0))
+                       if (eina_fnmatch(usergroup, pw->pw_name, 0))
                          {
                             in_usergroup = EINA_TRUE;
                          }
@@ -87,7 +87,7 @@ _etc_enlightenment_system_conf_check(const char *sys)
                             gp = getgrgid(gl[i]);
                             if (gp)
                               {
-                                 if (!fnmatch(usergroup, gp->gr_name, 0))
+                                 if (eina_fnmatch(usergroup, gp->gr_name, 0))
                                    {
                                       in_usergroup = EINA_TRUE;
                                       break;
diff --git a/src/modules/mixer/emixer.c b/src/modules/mixer/emixer.c
index beec52504..ab9266d6a 100644
--- a/src/modules/mixer/emixer.c
+++ b/src/modules/mixer/emixer.c
@@ -42,7 +42,7 @@ _glob_case_match(const char *str, const char *pattern)
    for (tp = tglob, p = pattern; *p != 0; p++, tp++)
    *tp = tolower(*p);
    *tp = 0;
-   if (!fnmatch(tglob, tstr, 0)) return 1;
+   if (eina_fnmatch(tglob, tstr, 0)) return 1;
    return 0;
 }
 

-- 


Reply via email to