backport fix.
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 18 Sep 2012 11:34:45 +0000 (11:34 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 18 Sep 2012 11:34:45 +0000 (11:34 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/branches/ecore-1.7@76804 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

AUTHORS
ChangeLog
NEWS
src/lib/ecore_file/ecore_file.c

diff --git a/AUTHORS b/AUTHORS
index f531462..83bc535 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -52,3 +52,4 @@ Doyoun Kang <wayofmine@gmail.com> <doyoun.kang@samsung.com>
 Haifeng Deng <haifeng.deng@samsung.com>
 Jérémy Zurcher <jeremy@asynk.ch>
 Vikram Narayanan <vikram186@gmail.com>
+Patryk Kaczmarek <patryk.k@samsung.com>
index 3d8ec2d..c12974a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_NORMAL, ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_FLOATING
 
 
+2012-09-18  Patryk Kaczmarek
+
+       * Fix escaping in ecore_file_escape_name() to handle tab and
+       newline right.
+
diff --git a/NEWS b/NEWS
index f775453..f10312e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Changes since Ecore 1.7.0:
 
 Fixes:
     * ecore_evas rotation handling on some driver implementations
+    * ecore_file_escape_name() escape taba nd newline right.
 
 Changes since Ecore 1.2.0:
 --------------------------
index cc0be54..e8400ca 100644 (file)
@@ -1017,19 +1017,41 @@ ecore_file_escape_name(const char *filename)
      {
         if ((q - buf) > (PATH_MAX - 6)) return NULL;
         if (
-            (*p == ' ') || (*p == '\t') || (*p == '\n') ||
-            (*p == '\\') || (*p == '\'') || (*p == '\"') ||
-            (*p == ';') || (*p == '!') || (*p == '#') ||
-            (*p == '$') || (*p == '%') || (*p == '&') ||
-            (*p == '*') || (*p == '(') || (*p == ')') ||
-            (*p == '[') || (*p == ']') || (*p == '{') ||
-            (*p == '}') || (*p == '|') || (*p == '<') ||
-            (*p == '>') || (*p == '?')
+            (*p == ' ') || (*p == '\\') || (*p == '\'') ||
+            (*p == '\"') || (*p == ';') || (*p == '!') ||
+            (*p == '#') || (*p == '$') || (*p == '%') ||
+            (*p == '&') || (*p == '*') || (*p == '(') ||
+            (*p == ')') || (*p == '[') || (*p == ']') ||
+            (*p == '{') || (*p == '}') || (*p == '|') ||
+            (*p == '<') || (*p == '>') || (*p == '?')
             )
           {
              *q = '\\';
              q++;
           }
+        else if (*p == '\t')
+          {
+             *q = '\\';
+             q++;
+             *q = '\\';
+             q++;
+             *q = 't';
+             q++;
+             p++;
+             continue;
+          }
+        else if (*p == '\n')
+          {
+            *q = '\\';
+            q++;
+            *q = '\\';
+            q++;
+            *q = 'n';
+            q++;
+            p++;
+           continue;
+          }
+
         *q = *p;
         q++;
         p++;