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:
authorCampbell Barton <ideasman42@gmail.com>2008-02-13 16:55:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-02-13 16:55:22 +0300
commitbc9848f7e67c3e695403179f8bcdb78b0e5764a3 (patch)
tree18561a90fa2660b5227a0c73c1d519d8a58cfab3 /source/blender/blenkernel
parente26b5aa9c47fbc604c23efe9100940ff68d8ddbe (diff)
Added a global string to be used for the tempdir. since the user preference is not loaded in background mode and the user preference is not validated and has no fallback.
'btempdir' is set with BLI_where_is_temp() - This tries to use U.tempdir but falls back to $TEMP or /tmp/
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/bad_level_call_stubs/stubs.c1
-rw-r--r--source/blender/blenkernel/intern/blender.c4
-rw-r--r--source/blender/blenkernel/intern/pointcache.c10
3 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c
index 1bec1775234..e7a8fd5278d 100644
--- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c
+++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c
@@ -49,6 +49,7 @@
int winqueue_break= 0;
char bprogname[1];
+char btempdir[1];
struct IpoCurve;
struct FluidsimSettings;
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 224d6af6336..8574cf00e8d 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -605,7 +605,7 @@ void BKE_write_undo(char *name)
counter= counter % U.undosteps;
sprintf(numstr, "%d.blend", counter);
- BLI_make_file_string("/", tstr, U.tempdir, numstr);
+ BLI_make_file_string("/", tstr, btempdir, numstr);
success= BLO_write_file(tstr, G.fileflags, &err);
@@ -716,7 +716,7 @@ void BKE_undo_save_quit(void)
/* no undo state to save */
if(undobase.first==undobase.last) return;
- BLI_make_file_string("/", str, U.tempdir, "quit.blend");
+ BLI_make_file_string("/", str, btempdir, "quit.blend");
file = open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
if(file == -1) {
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 13f5cb26e94..7d3b6ca0569 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -51,9 +51,6 @@
#include "BLI_winstuff.h"
#endif
-/* for U.tempdir */
-#include "DNA_userdef_types.h"
-
/* Takes an Object ID and returns a unique name
- id: object id
@@ -79,9 +76,8 @@ static int ptcache_path(char *filename)
return strlen(filename);
} else {
/* use the temp path. this is weak but better then not using point cache at all */
- if (U.tempdir[0] != '\0' && BLI_exists(U.tempdir)) {
- return sprintf(filename, "%s/"PTCACHE_PATH"untitled/", U.tempdir);
- }
+ /* btempdir is assumed to exist and ALWAYS has a trailing slash */
+ return sprintf(filename, "%s"PTCACHE_PATH"untitled/", btempdir);
}
return -1;
}
@@ -100,7 +96,7 @@ int BKE_ptcache_id_filename(struct ID *id, char *filename, int cfra, int stack_i
if (do_path) {
len = ptcache_path(filename);
if (len==-1)
- return;
+ return -1;
newname += len;
}
idname = (id->name+2);