From d1be55f41c47aead9ba21723633d3ab195f5113d Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sun, 6 Nov 2005 16:32:54 +0000 Subject: Small fix to allow relative filenames for textfiles. --- source/blender/blenkernel/intern/text.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 361544ef1a2..4557bd0404d 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -217,12 +217,15 @@ int reopen_text(Text *text) TextLine *tmp; char sdir[FILE_MAXDIR]; char sfile[FILE_MAXFILE]; + char str[FILE_MAXDIR+FILE_MAXFILE]; if (!text || !text->name) return 0; - BLI_split_dirfile(text->name, sdir, sfile); + BLI_strncpy(str, text->name, FILE_MAXDIR+FILE_MAXFILE); + BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + BLI_split_dirfile(str, sdir, sfile); - fp= fopen(text->name, "r"); + fp= fopen(str, "r"); if(fp==NULL) return 0; /* free memory: */ @@ -314,10 +317,13 @@ Text *add_text(char *file) Text *ta; char sdir[FILE_MAXDIR]; char sfile[FILE_MAXFILE]; + char str[FILE_MAXDIR+FILE_MAXFILE]; - BLI_split_dirfile(file, sdir, sfile); + BLI_strncpy(str, file, FILE_MAXDIR+FILE_MAXFILE); + BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + BLI_split_dirfile(str, sdir, sfile); - fp= fopen(file, "r"); + fp= fopen(str, "r"); if(fp==NULL) return NULL; ta= alloc_libblock(&G.main->text, ID_TXT, sfile); -- cgit v1.2.3