- [#22492] [29159] commit breaks importing of script file that has a reload to self...
[blender.git] / source / blender / blenkernel / intern / image.c
index f860f57993030e7d26674e051b19094852b75cf5..ef95139abda44c90ebda8a464d17343eff279e86 100644 (file)
@@ -440,10 +440,8 @@ Image *BKE_add_image_imbuf(ImBuf *ibuf)
 {
        /* on save, type is changed to FILE in editsima.c */
        Image *ima;
-       char filename[sizeof(ibuf->name)];
 
-       BLI_split_dirfile(ibuf->name, NULL, filename);
-       ima= image_alloc(filename, IMA_SRC_FILE, IMA_TYPE_IMAGE);
+       ima= image_alloc(BLI_path_basename(ibuf->name), IMA_SRC_FILE, IMA_TYPE_IMAGE);
 
        if (ima) {
                BLI_strncpy(ima->name, ibuf->name, FILE_MAX);