Enlightenment CVS committal

Author  : ningerso
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_engines.c 


Log Message:
Stricter checks on engine names in listing.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- ewl_engines.c       4 Jan 2007 05:09:47 -0000       1.34
+++ ewl_engines.c       8 Jan 2007 03:25:51 -0000       1.35
@@ -85,13 +85,17 @@
        ecore_list_goto_first(files);
        while ((file = ecore_list_next(files)))
        {
-               int len;
+               char *ext;
 
-               len = strlen(file);
-               if (!strncmp(file + (len - 3), ".so", 3))
+               ext = strchr(file, '.');
+               if (ext)
                {
-                       file[len - 3] = '\0';
-                       ecore_list_append(names, strdup(file));
+                       char *lastext;
+                       lastext = strrchr(file, '.');
+                       if (!strncmp(lastext, ".so", 3) && ext == lastext) {
+                               *ext = '\0';
+                               ecore_list_append(names, strdup(file));
+                       }
                }
        }
        ecore_list_destroy(files);



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to