- check paths are not empty strings before making blend file paths absolute or relative.

- when saving blend file with 'Remap Relative' enabled, don't try make paths absolute if the internal filename is invalid.
- use case insensitive path comparison on windows when checking if path remapping is needed & for comparing next/prev dirs in the file selector.
This commit is contained in:
2011-05-18 06:48:52 +00:00
parent 37178ab0fd
commit c92c3758a8
3 changed files with 22 additions and 6 deletions

View File

@@ -699,7 +699,12 @@ void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports) {
/* be sure there is low chance of the path being too short */
char filepath_relative[(FILE_MAXDIR * 2) + FILE_MAXFILE];
if(basedir[0] == '\0') {
printf("makeFilesRelative: basedir='', this is a bug\n");
return;
}
BLI_bpathIterator_init(&bpi, bmain, basedir, 0);
while (!BLI_bpathIterator_isDone(bpi)) {
BLI_bpathIterator_getPath(bpi, filepath);
@@ -751,7 +756,10 @@ void makeFilesAbsolute(Main *bmain, const char *basedir, ReportList *reports)
/* be sure there is low chance of the path being too short */
char filepath_absolute[(FILE_MAXDIR * 2) + FILE_MAXFILE];
BLI_assert(basedir[0] != '\0');
if(basedir[0] == '\0') {
printf("makeFilesAbsolute: basedir='', this is a bug\n");
return;
}
BLI_bpathIterator_init(&bpi, bmain, basedir, 0);
while (!BLI_bpathIterator_isDone(bpi)) {