lol the hak...fix coming up

db4
Doug Coleman 2009-01-21 20:12:09 -06:00
parent 8c5c973116
commit 1dc7ecfdc5
1 changed files with 7 additions and 4 deletions

View File

@ -112,9 +112,10 @@ bool save_image(const F_CHAR *filename)
FILE* file;
F_HEADER h;
F_CHAR temporary_filename[] = "##saving-factor-image##";
F_CHAR temporary_filename[] = STRING_LITERAL("##saving-factor-image##");
file = OPEN_WRITE(temporary_filename);
file = OPEN_WRITE(filename);
//file = OPEN_WRITE(temporary_filename);
if(file == NULL)
{
print_string("Cannot open image file: "); print_native_string(filename); nl();
@ -165,11 +166,13 @@ bool save_image(const F_CHAR *filename)
return false;
}
return true;
if(MOVE_FILE_FAILS(temporary_filename, filename))
{
print_string("Failed to rename tempoarary image file: "); print_string(strerror(errno)); nl();
if(DELETE_FILE_FAILS(temporary_filename))
print_string("Failed to clean up temporary image file: "); print_string(strerror(errno)); nl();
//if(DELETE_FILE_FAILS(temporary_filename))
//print_string("Failed to clean up temporary image file: "); print_string(strerror(errno)); nl();
return false;
}