Fix BLI_cleanup_path: '.' at the start of a path

On windows "." was replaced with the root directory.
On other systems any path starting with a '.' would be replaced with "/"

This was added for the file selector only,
so better handle this in the file selector (though it looks not to be needed).
This commit is contained in:
Campbell Barton 2014-05-18 18:58:22 +10:00
parent 9127b8f2a3
commit a089a86edd
1 changed files with 0 additions and 14 deletions

View File

@ -365,14 +365,6 @@ void BLI_cleanup_path(const char *relabase, char *path)
*/
#ifdef WIN32
/* Note, this should really be moved to the file selector,
* since this function is used in many areas */
if (strcmp(path, ".") == 0) { /* happens for example in FILE_MAIN */
get_default_root(path);
return;
}
while ( (start = strstr(path, "\\..\\")) ) {
eind = start + strlen("\\..\\") - 1;
a = start - path - 1;
@ -400,12 +392,6 @@ void BLI_cleanup_path(const char *relabase, char *path)
memmove(start, eind, strlen(eind) + 1);
}
#else
if (path[0] == '.') { /* happens, for example in FILE_MAIN */
path[0] = '/';
path[1] = 0;
return;
}
while ( (start = strstr(path, "/../")) ) {
a = start - path - 1;
if (a > 0) {