forked from enlightenment/efl
From: Patryk Kaczmarek <patryk.k@samsung.com>
Subject: [E-devel] [Patch] [Ecore] ecore_file_escape_name fix for \n and \t Please review and consider the attached patch for ecore_file_escape_name function, now it correctly escapes tab and new line characters. SVN revision: 76803
This commit is contained in:
parent
001bac6058
commit
042ecacd0f
|
@ -53,3 +53,4 @@ Haifeng Deng <haifeng.deng@samsung.com>
|
||||||
Jérémy Zurcher <jeremy@asynk.ch>
|
Jérémy Zurcher <jeremy@asynk.ch>
|
||||||
Vikram Narayanan <vikram186@gmail.com>
|
Vikram Narayanan <vikram186@gmail.com>
|
||||||
Seong-ho Cho (DarkCircle) <darkcircle.0426@gmail.com>
|
Seong-ho Cho (DarkCircle) <darkcircle.0426@gmail.com>
|
||||||
|
Patryk Kaczmarek <patryk.k@samsung.com>
|
||||||
|
|
|
@ -951,3 +951,8 @@
|
||||||
* Add string to atom_items for ECORE_X_ATOM_E_ILLUME_WINDOW_STATE,
|
* Add string to atom_items for ECORE_X_ATOM_E_ILLUME_WINDOW_STATE,
|
||||||
ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_NORMAL, ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_FLOATING
|
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.
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ Fixes:
|
||||||
- Timeouts are handled correctly now (passing HTTP status 408 to
|
- Timeouts are handled correctly now (passing HTTP status 408 to
|
||||||
completion callback).
|
completion callback).
|
||||||
* ecore_evas rotation handling on some driver implementations
|
* ecore_evas rotation handling on some driver implementations
|
||||||
|
* ecore_file_escape_name() escape taba nd newline right.
|
||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
|
|
|
@ -1017,19 +1017,41 @@ ecore_file_escape_name(const char *filename)
|
||||||
{
|
{
|
||||||
if ((q - buf) > (PATH_MAX - 6)) return NULL;
|
if ((q - buf) > (PATH_MAX - 6)) return NULL;
|
||||||
if (
|
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 = '\\';
|
||||||
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;
|
||||||
q++;
|
q++;
|
||||||
p++;
|
p++;
|
||||||
|
|
Loading…
Reference in New Issue