diff options
author | Andrea Weikert <elubie@gmx.net> | 2005-11-06 19:32:54 +0300 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2005-11-06 19:32:54 +0300 |
commit | d1be55f41c47aead9ba21723633d3ab195f5113d (patch) | |
tree | ce1669f9ea3c22d8ca93b5bb5ab7ea95eb47caa9 /source/blender/blenkernel/intern/text.c | |
parent | 0fbd27fd9b6e8bc5b88861eafc17d47d1153bbf6 (diff) |
Small fix to allow relative filenames for textfiles.
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 14 |
1 files changed, 10 insertions, 4 deletions
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); |