- [#22492] [29159] commit breaks importing of script file that has a reload to self...
[blender.git] / source / blender / blenlib / intern / path_util.c
index 301b981cdc76d6da7baa56d8fd6b22d0c054a296..f91c38b8271f65f882617cea85e87d6731c68108 100644 (file)
@@ -1172,6 +1172,12 @@ void BLI_join_dirfile(char *string, const char *dir, const char *file)
        }
 }
 
+/* like pythons os.path.basename( ) */
+char *BLI_path_basename(char *path)
+{
+       const char *filename= BLI_last_slash(path);
+       return filename ? filename + 1 : path;
+}
 
 /*
   Produce image export path.