- strdup paths so that we know we can write into it.

SVN revision: 24709
This commit is contained in:
Dan Sinclair 2006-08-14 21:25:53 +00:00 committed by Dan Sinclair
parent c189c73f86
commit 03c0e9c47c
1 changed files with 6 additions and 2 deletions

View File

@ -6,6 +6,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <libgen.h>
#include <strings.h>
#include <Ecore.h>
@ -763,6 +764,7 @@ Ecore_List *
ecore_desktop_paths_to_list(char *paths)
{
Ecore_List *result;
char *path;
result = ecore_list_new();
if (result)
@ -774,7 +776,8 @@ ecore_desktop_paths_to_list(char *paths)
char *start, *end, temp;
int finished = 0;
end = paths;
path = strdup(paths);
end = path;
while (!finished)
{
start = end;
@ -784,7 +787,7 @@ ecore_desktop_paths_to_list(char *paths)
&& (*end != '\0'))
end++;
}
while ((end != paths) && (*(end - 1) == '\\') && (*end != '\0')); /* Ignore any escaped ;:, */
while ((end != path) && (*(end - 1) == '\\') && (*end != '\0')); /* Ignore any escaped ;:, */
/* FIXME: We still need to unescape it now. */
temp = *end;
if (*end == '\0')
@ -796,6 +799,7 @@ ecore_desktop_paths_to_list(char *paths)
*end = temp;
end++;
}
free(path);
}
}
return result;