eina: Fix "E restores default configuration on every restart"
authorstefan <stefan>
Tue, 13 Nov 2012 09:58:32 +0000 (09:58 +0000)
committerstefan <stefan@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 13 Nov 2012 09:58:32 +0000 (09:58 +0000)
Spankies for glima and huge thanks to Jérémy Zurcher for this fix.

Patch by: Jérémy Zurcher

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@79212 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/eina_file.c

index ea17b95..85e19ec 100644 (file)
@@ -560,19 +560,22 @@ _eina_file_escape(const char *path, int *length)
                      ++p;
                   }
            }
-        // remove '/./'
-        else if (p[2] == '/')
-          {
-             len -= p + 2 - q;
-             memmove(q, p + 2, len - (q - result));
-             result[len] = '\0';
-             p = q;
-          }
          else
-           {
-              q = p;
-              ++p;
-           }
+           if (p[1] == '.'
+                && p[2] == '/')
+              {
+                 // remove '/./'
+                 len -= 2;
+                 memmove(p, p + 2, len - (p - result));
+                 result[len] = '\0';
+                 q = p;
+                 ++p;
+              }
+            else
+              {
+                 q = p;
+                 ++p;
+              }
      }
 
    if (length)