Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2007-03-01 00:37:14 +0300
committerAndrea Weikert <elubie@gmx.net>2007-03-01 00:37:14 +0300
commitc7ad7cd1b03e2a6a5ddc9399264b9bdd2527a60d (patch)
treecdedceaca97511af60f35795b1c0c76b9e587d99 /source/blender/blenlib
parenta734d3cc27a381f0c37835c14653ff8802ebca14 (diff)
=== bugfix ===
[ #6077 ] Scripts in sub-sub-folders of Blender's scripts folder won't run. [ #5572 ] Scripts in sub-folders of Blender's scripts folder won't run - I've added a function in blenlib to join two strings with a path separator in between. - Willian, Campbell, please check if commit in BPY_menus is ok and test - thanks!
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_blenlib.h1
-rw-r--r--source/blender/blenlib/intern/util.c19
2 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h
index 58bd3fd6bf6..7b60aa178a7 100644
--- a/source/blender/blenlib/BLI_blenlib.h
+++ b/source/blender/blenlib/BLI_blenlib.h
@@ -96,6 +96,7 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir,
void BLI_make_exist(char *dir);
void BLI_make_existing_file(char *name);
void BLI_split_dirfile(const char *string, char *dir, char *file);
+void BLI_join_dirfile(char *string, const char *dir, const char *file);
int BLI_testextensie(const char *str, const char *ext);
void addlisttolist(ListBase *list1, ListBase *list2);
void BLI_insertlink(struct ListBase *listbase, void *vprevlink, void *vnewlink);
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c
index ab57b50516f..77ab4d67783 100644
--- a/source/blender/blenlib/intern/util.c
+++ b/source/blender/blenlib/intern/util.c
@@ -1255,7 +1255,24 @@ void BLI_split_dirfile(const char *string, char *dir, char *file)
}
#endif
}
-
+
+/* simple appending of filename to dir, does not check for valid path! */
+void BLI_join_dirfile(char *string, const char *dir, const char *file)
+{
+ int sl_dir = strlen(dir);
+ BLI_strncpy(string, dir, FILE_MAX);
+ if (sl_dir > FILE_MAX-1) sl_dir = FILE_MAX-1;
+#ifdef WIN32
+ string[sl_dir] = '\\';
+#else
+ string[sl_dir] = '/';
+#endif
+ sl_dir++;
+ if (sl_dir <FILE_MAX) {
+ BLI_strncpy(string + sl_dir, file, FILE_MAX-sl_dir);
+ }
+}
+
static int add_win32_extension(char *name)
{
int retval = 0;