Version patch for reading old files (2.50 and before).

In 2.50 a new convention was added to save the filename in the .blend itself. 
This to allow recovery of temp saves.

In current svn, it made old files open as if it was a saved home file (not
storing the name in header, or in file history).

Note: file handling for all recovery, remapping etc is in need for cleanup.
This commit is contained in:
Ton Roosendaal 2012-12-17 12:35:39 +00:00
parent b61958c80d
commit bf51b85871

@ -6608,6 +6608,10 @@ static BHead *read_global(BlendFileData *bfd, FileData *fd, BHead *bhead)
bfd->globalf = fg->globalf;
BLI_strncpy(bfd->filename, fg->filename, sizeof(bfd->filename));
/* early 2.50 version patch - filename not in FileGlobal struct */
if (fd->fileversion <= 250)
BLI_strncpy(bfd->filename, bfd->main->name, sizeof(bfd->main->name));
if (G.fileflags & G_FILE_RECOVER)
BLI_strncpy(fd->relabase, fg->filename, sizeof(fd->relabase));