ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=97e2192a2bb339fc52b2289e44181129e9b2a2b7

commit 97e2192a2bb339fc52b2289e44181129e9b2a2b7
Author: Andy Williams <a...@andywilliams.me>
Date:   Fri Sep 30 21:47:05 2016 +0100

    files: tidy code to be easier to read
    
    Thanks for the tip, vtorri
---
 src/lib/edi_build_provider_make.c | 35 ++++++++---------------------------
 1 file changed, 8 insertions(+), 27 deletions(-)

diff --git a/src/lib/edi_build_provider_make.c 
b/src/lib/edi_build_provider_make.c
index 730dd82..a0daa1e 100644
--- a/src/lib/edi_build_provider_make.c
+++ b/src/lib/edi_build_provider_make.c
@@ -33,36 +33,17 @@ _make_project_supported(const char *path)
 }
 
 static Eina_Bool
-_make_file_hidden_is(const char *relative)
+_make_file_hidden_is(const char *file)
 {
-   int len;
-
-   if (!relative || strlen(relative) == 0)
+   if (!file || strlen(file) == 0)
      return EINA_FALSE;
 
-   len = strlen(relative);
-   if (relative[len-1] == 'o' && len >= 2)
-     {
-        if (relative[len-2] == '.')
-          return EINA_TRUE;
-        else
-          {
-            if ((relative[len-2] == 's' || relative[len-2] == 'l') &&
-              len >= 3 && relative[len-3] == '.')
-              return EINA_TRUE;
-          }
-     }
-   if (relative[len-1] == 'a' && len >= 2)
-     {
-        if (relative[len-2] == '.')
-          return EINA_TRUE;
-        else
-          {
-            if ((relative[len-2] == 'l') &&
-              len >= 3 && relative[len-3] == '.')
-              return EINA_TRUE;
-          }
-     }
+   if (eina_str_has_extension(file, "o") || eina_str_has_extension(file, "so") 
||
+       eina_str_has_extension(file, "lo"))
+     return EINA_TRUE;
+   if (eina_str_has_extension(file, "a") || eina_str_has_extension(file, "la"))
+     return EINA_TRUE;
+
    return EINA_FALSE;
 }
 

-- 


Reply via email to