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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-14 14:44:34 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-14 14:44:34 +0400
commitee9437f794d0c583a3535b94ab22231a1f3a4f58 (patch)
tree7fc9df12d56763820d1ca9b059686927dd82f580 /source/blender
parent7ad8e5b6f87fbee78d6676e33b80be9cfc74feea (diff)
Fix for #22818: blender doesn't find a systemwide installed python.
What happens is that blender looks for a directory "python" in the same place as the executable for local installations, but that also means when you have /usr/bin/blender it will look for /usr/bin/python, which is an executable. Now it checks if it is actually a directory and not a file.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenlib/intern/path_util.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index a75d57a988e..423bf452a4d 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -747,7 +747,7 @@ char *BLI_gethome(void) {
ret = getenv("HOME");
if(ret) {
sprintf(dir, "%s\\%s", ret, blender_version_decimal());
- if (BLI_exists(dir)) return dir;
+ if (BLI_is_dir(dir)) return dir;
}
/* else, check install dir (path containing blender.exe) */
@@ -755,7 +755,7 @@ char *BLI_gethome(void) {
if(BLI_getInstallationDir(dir))
{
sprintf(dir, "%s", dir, blender_version_decimal());
- if (BLI_exists(dir)) return(dir);
+ if (BLI_is_dir(dir)) return(dir);
}
@@ -768,24 +768,24 @@ char *BLI_gethome(void) {
if (hResult == S_OK)
{
- if (BLI_exists(appdatapath)) { /* from fop, also below... */
+ if (BLI_is_dir(appdatapath)) { /* from fop, also below... */
sprintf(dir, "%s\\Blender Foundation\\Blender", appdatapath);
BLI_recurdir_fileops(dir);
- if (BLI_exists(dir)) {
+ if (BLI_is_dir(dir)) {
sprintf(dir,"%s\\%s", dir, blender_version_decimal());
- if(BLI_exists(dir)) return(dir);
+ if(BLI_is_dir(dir)) return(dir);
}
}
hResult = SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, appdatapath);
if (hResult == S_OK)
{
- if (BLI_exists(appdatapath))
+ if (BLI_is_dir(appdatapath))
{ /* from fop, also below... */
sprintf(dir, "%s\\Blender Foundation\\Blender", appdatapath);
BLI_recurdir_fileops(dir);
- if (BLI_exists(dir)) {
+ if (BLI_is_dir(dir)) {
sprintf(dir,"%s\\%s", dir, blender_version_decimal());
- if(BLI_exists(dir)) return(dir);
+ if(BLI_is_dir(dir)) return(dir);
}
}
}
@@ -809,7 +809,7 @@ static int test_data_path(char *targetpath, char *path_base, char *path_sep, cha
BLI_make_file_string("/", targetpath, tmppath, folder_name);
- if (BLI_exists(targetpath)) {
+ if (BLI_is_dir(targetpath)) {
#ifdef PATH_DEBUG
printf("\tpath found: %s\n", targetpath);
#endif
@@ -932,7 +932,7 @@ static int test_path(char *targetpath, char *path_base, char *path_sep, char *fo
BLI_make_file_string("/", targetpath, tmppath, folder_name);
- if (BLI_exists(targetpath)) {
+ if (BLI_is_dir(targetpath)) {
#ifdef PATH_DEBUG2
printf("\tpath found: %s\n", targetpath);
#endif
@@ -952,7 +952,7 @@ static int test_env_path(char *path, char *envvar)
char *env = envvar?getenv(envvar):NULL;
if (!env) return 0;
- if (BLI_exists(env)) {
+ if (BLI_is_dir(env)) {
BLI_strncpy(path, env, FILE_MAX);
return 1;
} else {
@@ -1245,7 +1245,7 @@ void BLI_make_exist(char *dir) {
a = strlen(dir);
#ifdef WIN32
- while(BLI_exists(dir) == 0){
+ while(BLI_is_dir(dir) == 0){
a --;
while(dir[a] != '\\'){
a--;
@@ -1259,7 +1259,7 @@ void BLI_make_exist(char *dir) {
}
}
#else
- while(BLI_exist(dir) == 0){
+ while(BLI_is_dir(dir) == 0){
a --;
while(dir[a] != '/'){
a--;
@@ -1682,7 +1682,7 @@ void BLI_where_is_temp(char *fullname, int usertemp)
{
fullname[0] = '\0';
- if (usertemp && BLI_exists(U.tempdir)) {
+ if (usertemp && BLI_is_dir(U.tempdir)) {
strcpy(fullname, U.tempdir);
}
@@ -1690,7 +1690,7 @@ void BLI_where_is_temp(char *fullname, int usertemp)
#ifdef WIN32
if (fullname[0] == '\0') {
char *tmp = getenv("TEMP"); /* Windows */
- if (tmp && BLI_exists(tmp)) {
+ if (tmp && BLI_is_dir(tmp)) {
strcpy(fullname, tmp);
}
}
@@ -1698,14 +1698,14 @@ void BLI_where_is_temp(char *fullname, int usertemp)
/* Other OS's - Try TMP and TMPDIR */
if (fullname[0] == '\0') {
char *tmp = getenv("TMP");
- if (tmp && BLI_exists(tmp)) {
+ if (tmp && BLI_is_dir(tmp)) {
strcpy(fullname, tmp);
}
}
if (fullname[0] == '\0') {
char *tmp = getenv("TMPDIR");
- if (tmp && BLI_exists(tmp)) {
+ if (tmp && BLI_is_dir(tmp)) {
strcpy(fullname, tmp);
}
}