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/editors | |
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/editors')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_add.c | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 8b8b3b11324..33adc11caa0 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -862,7 +862,6 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera BKE_image_release_renderresult(scene, ima); } else if (BKE_write_ibuf(scene, ibuf, path, sima->imtypenr, scene->r.subimtype, scene->r.quality)) { - char *name; if(relative) BLI_path_rel(path, G.sce); /* only after saving */ @@ -895,10 +894,8 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera ima->type= IMA_TYPE_IMAGE; } - name = BLI_last_slash(path); - /* name image as how we saved it */ - rename_id(&ima->id, name ? name + 1 : path); + rename_id(&ima->id, BLI_path_basename(path)); } } else diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index c1b30ab155a..f36461ab7e0 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -421,7 +421,7 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) RNA_END; } else { - BLI_split_dirfile(seq_load.path, NULL, se->name); + BLI_strncpy(se->name, BLI_path_basename(seq_load.path), sizeof(se->name)); if(seq_load.start_frame < seq_load.end_frame) { seq->endstill= seq_load.end_frame - seq_load.start_frame; } |