- string const fform = convert<string>(d->file_format);
- string const backname = fname + "-lyxformat-" + fform;
+ string backup_suffix;
+ // If file format is from a stable series use version instead of file format
+ auto const it = file_formats.find(d->file_format);
+ if (it != file_formats.end())
+ backup_suffix = "-lyx" + it->second;
+ else
+ backup_suffix = "-lyxformat-" + convert<string>(d->file_format);
+ string const backname = fname + backup_suffix;