fix efreet/file monitor stringshare optimization

fixes e4d815dc48 that i just put in a
few days back - it's a good idea to copy the string into your buffer
to use it.. not just 0 terminate it. :)
This commit is contained in:
Carsten Haitzler 2016-04-23 23:45:28 +09:00
parent df2b31b63e
commit bbcde33f93
3 changed files with 3 additions and 0 deletions

View File

@ -126,6 +126,7 @@ ecore_file_monitor_backend_add(const char *path,
len = strlen(path);
path2 = alloca(len + 1);
strcpy(path2, path);
if (path2[len - 1] == '/' && strcmp(path2, "/")) path2[len - 1] = 0;
em->path = eina_stringshare_add(path2);

View File

@ -87,6 +87,7 @@ ecore_file_monitor_backend_add(const char *path,
len = strlen(path);
path2 = alloca(len + 1);
strcpy(path2, path);
if (path2[len - 1] == '/' && strcmp(path2, "/")) path2[len - 1] = 0;
em->path = eina_stringshare_add(path2);

View File

@ -259,6 +259,7 @@ ecore_file_monitor_backend_add(const char *path,
len = strlen(path);
path2 = alloca(len + 1);
strcpy(path2, path);
if (path2[len - 1] == '/' || path2[len - 1] == '\\') path2[len - 1] = 0;
em->path = eina_stringshare_add(path2);