Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_fileselector.c 


Log Message:
- if we've predeclared to be static, make the function static
- make sure we strdup any strings we are returning if we say to free it

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fileselector.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -3 -r1.51 -r1.52
--- ewl_fileselector.c  21 Dec 2004 01:45:19 -0000      1.51
+++ ewl_fileselector.c  21 Dec 2004 04:00:32 -0000      1.52
@@ -283,7 +283,7 @@
 }
 
 /* if non NULL, result must be freed */
-char *ewl_fileselector_path_up_get(char *path)
+static char *ewl_fileselector_path_up_get(char *path)
 {
        char *new_path;
        int l;
@@ -296,13 +296,13 @@
                l--;
 
        if (l < 0)
-               return "/";
+               return strdup("/");
 
        while ((l >= 0) && (path[l] != '/'))
                l--;
 
        if (l < 0)
-               return "/";
+               return strdup("/");
        else {
                l++;
                new_path = (char *) malloc(sizeof(char) * (l + 1));
@@ -313,14 +313,15 @@
 }
 
 /* if non NULL, result must be freed */
-char *ewl_fileselector_path_home_get()
+static char *ewl_fileselector_path_home_get()
 {
        char *path;
        char *new_path;
 
        path = getenv("HOME");
        if ((!path) || (strlen(path) == 0))
-               path = "/";
+               path = strdup("/");
+
        if (path[strlen(path)] != '/')
                new_path = ewl_fileselector_str_append(path, "/");
        else
@@ -329,7 +330,7 @@
        return new_path;
 }
 
-char *ewl_fileselector_size_string_get(off_t st_size)
+static char *ewl_fileselector_size_string_get(off_t st_size)
 {
        double dsize;
        char size[1024];
@@ -356,7 +357,7 @@
        return strdup(size);
 }
 
-char *ewl_fileselector_perm_string_get(mode_t st_mode)
+static char *ewl_fileselector_perm_string_get(mode_t st_mode)
 {
        char *perm;
        int i;
@@ -391,7 +392,8 @@
        return perm;
 }
 
-void ewl_fileselector_file_list_get(char *path, char *filter, Ecore_List * 
flist, Ecore_List * dlist)
+static void ewl_fileselector_file_list_get(char *path, char *filter, 
+                               Ecore_List * flist, Ecore_List * dlist)
 {
        regex_t preg;
        Ewl_Fileselector_Data *d;




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to