Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/file


Modified Files:
        evas_module.c 


Log Message:


fix egetnv of $HOME null return

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/file/evas_module.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- evas_module.c       16 Jan 2006 03:37:33 -0000      1.12
+++ evas_module.c       1 Feb 2006 06:19:38 -0000       1.13
@@ -54,14 +54,20 @@
    
    /* 1. ~/.evas/modules/ */
    prefix = getenv("HOME");
-   path = malloc(strlen(prefix) + 1 + strlen("/.evas/modules"));
-   path[0] = 0;
-   strcpy(path, prefix);
-   strcat(path, "/.evas/modules");
-   if (evas_file_path_exists(path))
-     paths = evas_list_append(paths,path);
-   else
-     free(path);
+   if (prefix)
+     {
+       path = malloc(strlen(prefix) + 1 + strlen("/.evas/modules"));
+       if (path)
+         {
+            path[0] = 0;
+            strcpy(path, prefix);
+            strcat(path, "/.evas/modules");
+            if (evas_file_path_exists(path))
+              paths = evas_list_append(paths, path);
+            else
+              free(path);
+         }
+     }
 
 #ifdef HAVE_DLADDR
      {
@@ -94,12 +100,15 @@
    /* 3. PREFIX/evas/modules/ */
    prefix = PACKAGE_LIB_DIR; 
    path = malloc(strlen(prefix) + 1 + strlen("/evas/modules"));
-   strcpy(path, prefix);
-   strcat(path, "/evas/modules");
-   if (evas_file_path_exists(path))
-     paths = evas_list_append(paths, path);
-   else
-     free(path);
+   if (path)
+     {
+       strcpy(path, prefix);
+       strcat(path, "/evas/modules");
+       if (evas_file_path_exists(path))
+         paths = evas_list_append(paths, path);
+       else
+         free(path);
+     }
 #endif
    
    /* append all the module types subdirs */
@@ -145,7 +154,7 @@
             if ((!strcmp(de->d_name, ".")) || (!strcmp(de->d_name, "..")))
               continue;
             buf = malloc(strlen(mp->path) + 1 + strlen(de->d_name) + 1);
-            sprintf(buf,"%s/%s", mp->path,de->d_name);
+            sprintf(buf, "%s/%s", mp->path, de->d_name);
             if (evas_file_path_is_dir(buf))
               {
                  Evas_Module *em;




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to