Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_desktop


Modified Files:
        ecore_desktop.c 


Log Message:
Only strip trailing slashes.

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/ecore_desktop.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ecore_desktop.c     21 Aug 2006 17:54:22 -0000      1.12
+++ ecore_desktop.c     21 Aug 2006 18:25:16 -0000      1.13
@@ -460,19 +460,16 @@
 char *
 ecore_desktop_home_get()
 {
-   char               *d;
-   char                home[PATH_MAX];
+   char   home[PATH_MAX];
+   int    len;
 
    /* Get Home Dir, check for trailing '/', strip it */
    strncpy(home, getenv("HOME"), PATH_MAX);
-   d = strrchr(home, '/');
-   if (d)
+   len = strlen(home) - 1;
+   while ((len >= 0) && (home[len] == '/'))
      {
-       while (*d == '/')
-         {
-            *d = 0;
-            d--;
-         }
+       home[len] = '\0';
+       len--;
      }
 
    return strdup(home);



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to