forked from enlightenment/efl
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:
parent
df2b31b63e
commit
bbcde33f93
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue