diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-06-06 01:19:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-06-06 01:19:59 +0400 |
commit | 4da179749eb8d6b53f5c2eba4b3e4132656c3d4f (patch) | |
tree | 59b4dbfac1c894687f022efb72a9c010c93e555f /source/blender/blenkernel/intern/text.c | |
parent | c12068920391c006cf5e72c1fafb4ebf8f807a55 (diff) |
- [#22492] [29159] commit breaks importing of script file that has a reload to self in it
broke when including the blend path in the modules filename.
- new function BLI_path_basename(), matches pythons os.path.basename().
replace a number of cases where BLI_split_dirfile was being used to get the filename only.
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index f1036b66f69..e8328d0e622 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -232,7 +232,6 @@ int reopen_text(Text *text) int i, llen, len, res; unsigned char *buffer; TextLine *tmp; - char sfile[FILE_MAXFILE]; char str[FILE_MAXDIR+FILE_MAXFILE]; struct stat st; @@ -240,7 +239,6 @@ int reopen_text(Text *text) BLI_strncpy(str, text->name, FILE_MAXDIR+FILE_MAXFILE); BLI_path_abs(str, G.sce); - BLI_split_dirfile(str, NULL, sfile); fp= fopen(str, "r"); if(fp==NULL) return 0; @@ -331,19 +329,17 @@ Text *add_text(char *file, const char *relpath) unsigned char *buffer; TextLine *tmp; Text *ta; - char sfile[FILE_MAXFILE]; char str[FILE_MAXDIR+FILE_MAXFILE]; struct stat st; BLI_strncpy(str, file, FILE_MAXDIR+FILE_MAXFILE); if (relpath) /* can be NULL (bg mode) */ BLI_path_abs(str, relpath); - BLI_split_dirfile(str, NULL, sfile); fp= fopen(str, "r"); if(fp==NULL) return NULL; - ta= alloc_libblock(&G.main->text, ID_TXT, sfile); + ta= alloc_libblock(&G.main->text, ID_TXT, BLI_path_basename(str)); ta->id.us= 1; ta->lines.first= ta->lines.last= NULL; |