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:
authorTon Roosendaal <ton@blender.org>2004-12-16 17:40:25 +0300
committerTon Roosendaal <ton@blender.org>2004-12-16 17:40:25 +0300
commit1b4667b33f4937f3ae2ee1c4f0661d35b14cdffd (patch)
treeb15db342dfaba42e42e6d8d734f6111f92ab3075 /source/blender/blenloader/intern
parent6719d88aab15627bdbe05f7ac116addffd2e165f (diff)
Errors in saving runtime, and fileops in file window; files were copied
or deleted without keeping track of spaces in names, causing in potential loss of data. Needs review!
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/writefile.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index a325749dede..7fc8ac914e4 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1667,7 +1667,8 @@ static char *get_runtime_path(char *exename) {
#ifdef __APPLE__
-static int recursive_copy_runtime(char *outname, char *exename, char **cause_r) {
+static int recursive_copy_runtime(char *outname, char *exename, char **cause_r)
+{
char *cause = NULL, *runtime = get_runtime_path(exename);
char command[2 * (FILE_MAXDIR+FILE_MAXFILE) + 32];
int progfd = -1;
@@ -1676,14 +1677,16 @@ static int recursive_copy_runtime(char *outname, char *exename, char **cause_r)
cause= "Unable to find runtime";
goto cleanup;
}
-
+ //printf("runtimepath %s\n", runtime);
+
progfd= open(runtime, O_BINARY|O_RDONLY, 0);
if (progfd==-1) {
cause= "Unable to find runtime";
goto cleanup;
}
- sprintf(command, "/bin/cp -R %s %s", runtime, outname);
+ sprintf(command, "/bin/cp -R \"%s\" \"%s\"", runtime, outname);
+ //printf("command %s\n", command);
if (system(command) == -1) {
cause = "Couldn't copy runtime";
}
@@ -1707,6 +1710,7 @@ void BLO_write_runtime(char *file, char *exename) {
char *cause= NULL;
// remove existing file / bundle
+ //printf("Delete file %s\n", file);
BLI_delete(file, NULL, TRUE);
if (!recursive_copy_runtime(file, exename, &cause))
@@ -1714,7 +1718,7 @@ void BLO_write_runtime(char *file, char *exename) {
strcpy(gamename, file);
strcat(gamename, "/Contents/Resources/game.blend");
-
+ //printf("gamename %s\n", gamename);
outfd= open(gamename, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0777);
if (outfd != -1) {