kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=f98c2e98791710479c5505e1106bfcc6e9393113

commit f98c2e98791710479c5505e1106bfcc6e9393113
Author: Kim Woelders <k...@woelders.dk>
Date:   Wed Jan 3 22:03:06 2018 +0100

    theme.c: Tweak theme listing
---
 src/theme.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/theme.c b/src/theme.c
index 813b65db..d7b41c0f 100644
--- a/src/theme.c
+++ b/src/theme.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
- * Copyright (C) 2004-2017 Kim Woelders
+ * Copyright (C) 2004-2018 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -149,24 +149,27 @@ _append_merge_dir(char *dir, char ***list, int *count)
                goto got_one;
             continue;
          }
-       else if (isfile(ss))
+
+       if (!isfile(ss))
+          continue;
+
+       s = strrchr(ss, '.');
+       if (!s)
+          continue;
+
+       if (strcmp(s + 1, "etheme") == 0)
          {
-            s = strstr(str[i], ".etheme");
-            if (!s)
-               continue;
             Esnprintf(s1, sizeof(s1), "%s/themes/%s", EDirUser(), str[i]);
-            s = strstr(s1, ".etheme");
+            s = strrchr(s1, '.');
             if (!s)
                continue;
             *s = '\0';
-            if (isdir(s1))
-               continue;
-         }
-       else
-         {
-            continue;
+            if (!isdir(s1))
+               goto got_one;
          }
 
+       continue;
+
       got_one:
        (*count)++;
        *list = EREALLOC(char *, *list, *count);

-- 


Reply via email to