Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : libs/ecore

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


Modified Files:
        ecore_desktop.c 


Log Message:
*Not all white space is treated the same here, so using isspace is not
correct.  In this case, use of isspace causes bugs where only the
initial word of names is used, exe parameters are stripped, etc.

*The exe params should be strdup'ed just like all the others.  This one
is my fault.

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/ecore_desktop.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- ecore_desktop.c     24 Sep 2006 09:28:21 -0000      1.45
+++ ecore_desktop.c     24 Sep 2006 16:37:43 -0000      1.46
@@ -74,14 +74,15 @@
 
        c = buffer;
        /* Strip preceeding blanks. */
-       while ((*c != '\0') && (isspace(*c))) c++;
+        while (((*c == ' ') || (*c == '\t')) && (*c != '\n') && (*c != '\0'))
+               c++;
        /* Skip blank lines and comments */
        if ((*c == '\0') || (*c == '\n') || (*c == '#')) continue;
        if (*c == '[')  /* New group. */
          {
             key = c + 1;
             while ((*c != ']') && (*c != '\n') && (*c != '\0'))
-              c++;
+               c++;
             *c++ = '\0';
             current = ecore_hash_new(ecore_str_hash, ecore_str_compare);
             if (current)
@@ -100,20 +101,24 @@
 
             key = c;
             /* Find trailing blanks or =. */
-            while ((*c != '\0') && (*c != '=') && (!isspace(*c))) c++;
+            while ((*c != '=') && (*c != ' ') && (*c != '\t') && (*c != '\n') 
&& (*c != '\0'))
+               c++;
             if (*c != '=')     /* Find equals. */
               {
                  *c++ = '\0';
-                 while ((*c != '\0') && (*c != '=')) c++;
+                 while ((*c != '=') && (*c != '\n') && (*c != '\0'))
+                    c++;
               }
             if (*c == '=')     /* Equals found. */
               {
                  *c++ = '\0';
                  /* Strip preceeding blanks. */
-                 while ((*c != '\0') && (isspace(*c))) c++;
+                 while (((*c == ' ') || (*c == '\t')) && (*c != '\n') && (*c 
!= '\0'))
+                    c++;
                  value = c;
                  /* Find end. */
-                 while ((*c != '\0') && (!isspace(*c))) c++;
+                 while ((*c != '\n') && (*c != '\0'))
+                    c++;
                  *c++ = '\0';
                  /* FIXME: should strip space at end, then unescape value. */
                  tv = ecore_hash_remove(current, key);
@@ -248,7 +253,8 @@
                  if (exe)
                    {
                       *exe = '\0';
-                      result->exec_params = ++exe;
+                      exe++;
+                      result->exec_params = strdup(exe);
                    }
                  exe = result->exec;
               }



-------------------------------------------------------------------------
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