diff options
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 5 | ||||
-rw-r--r-- | source/blender/blenloader/BLO_undofile.h | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readblenentry.c | 6 | ||||
-rw-r--r-- | source/blender/blenloader/intern/undofile.c | 8 |
4 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index c1274de034d..043f9ffd723 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -156,10 +156,11 @@ BlendFileData *BLO_read_from_memory(const void *mem, * * \param oldmain: old main, * from which we will keep libraries and other data-blocks that should not have changed. - * \param filename: current file, only for retrieving library data. + * \param filepath: current file, only for retrieving library data. + * Typically `BKE_main_blendfile_path(oldmain)`. */ BlendFileData *BLO_read_from_memfile(struct Main *oldmain, - const char *filename, + const char *filepath, struct MemFile *memfile, const struct BlendFileReadParams *params, struct ReportList *reports); diff --git a/source/blender/blenloader/BLO_undofile.h b/source/blender/blenloader/BLO_undofile.h index 48334444c4c..0584f95d85f 100644 --- a/source/blender/blenloader/BLO_undofile.h +++ b/source/blender/blenloader/BLO_undofile.h @@ -46,7 +46,7 @@ typedef struct MemFileWriteData { } MemFileWriteData; typedef struct MemFileUndoData { - char filename[1024]; /* FILE_MAX */ + char filepath[1024]; /* FILE_MAX */ MemFile memfile; size_t undo_size; } MemFileUndoData; @@ -98,6 +98,6 @@ extern struct Main *BLO_memfile_main_get(struct MemFile *memfile, * * \return success. */ -extern bool BLO_memfile_write_file(struct MemFile *memfile, const char *filename); +extern bool BLO_memfile_write_file(struct MemFile *memfile, const char *filepath); FileReader *BLO_memfile_new_filereader(MemFile *memfile, int undo_direction); diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 10b69b67fa1..1bfa3b0e2bb 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -388,7 +388,7 @@ BlendFileData *BLO_read_from_memory(const void *mem, } BlendFileData *BLO_read_from_memfile(Main *oldmain, - const char *filename, + const char *filepath, MemFile *memfile, const struct BlendFileReadParams *params, ReportList *reports) @@ -401,7 +401,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, fd = blo_filedata_from_memfile(memfile, params, &bf_reports); if (fd) { fd->skip_flags = params->skip_flags; - BLI_strncpy(fd->relabase, filename, sizeof(fd->relabase)); + BLI_strncpy(fd->relabase, filepath, sizeof(fd->relabase)); /* separate libraries from old main */ blo_split_main(&old_mainlist, oldmain); @@ -420,7 +420,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, * read IDs whenever possible. */ blo_cache_storage_init(fd, oldmain); - bfd = blo_read_file_internal(fd, filename); + bfd = blo_read_file_internal(fd, filepath); /* Ensure relinked caches are not freed together with their old IDs. */ blo_cache_storage_old_bmain_clear(fd, oldmain); diff --git a/source/blender/blenloader/intern/undofile.c b/source/blender/blenloader/intern/undofile.c index 5c4598b85c5..bb3b6d0b75d 100644 --- a/source/blender/blenloader/intern/undofile.c +++ b/source/blender/blenloader/intern/undofile.c @@ -195,7 +195,7 @@ struct Main *BLO_memfile_main_get(struct MemFile *memfile, return bmain_undo; } -bool BLO_memfile_write_file(struct MemFile *memfile, const char *filename) +bool BLO_memfile_write_file(struct MemFile *memfile, const char *filepath) { MemFileChunk *chunk; int file, oflags; @@ -216,12 +216,12 @@ bool BLO_memfile_write_file(struct MemFile *memfile, const char *filename) # warning "Symbolic links will be followed on undo save, possibly causing CVE-2008-1103" # endif #endif - file = BLI_open(filename, oflags, 0666); + file = BLI_open(filepath, oflags, 0666); if (file == -1) { fprintf(stderr, "Unable to save '%s': %s\n", - filename, + filepath, errno ? strerror(errno) : "Unknown error opening file"); return false; } @@ -242,7 +242,7 @@ bool BLO_memfile_write_file(struct MemFile *memfile, const char *filename) if (chunk) { fprintf(stderr, "Unable to save '%s': %s\n", - filename, + filepath, errno ? strerror(errno) : "Unknown error writing file"); return false; } |