fix failed writes to "foo.sm" leaving "new.foo.sm" behind, which will
trigger an error on the next load
This commit is contained in:
@@ -66,10 +66,11 @@ RageFileDriverDirect::RageFileDriverDirect( CString root_ ):
|
|||||||
|
|
||||||
static CString MakeTempFilename( const CString &sPath )
|
static CString MakeTempFilename( const CString &sPath )
|
||||||
{
|
{
|
||||||
/* "Foo/bar/baz" -> "Foo/bar/new.baz". Prepend to the basename, so if we're
|
/* "Foo/bar/baz" -> "Foo/bar/new.baz.new". Both prepend and append: we don't
|
||||||
* writing something that might be wildcard-searched, these temp files won't
|
* want a wildcard search for the filename to match (foo.txt.new matches foo.txt*),
|
||||||
* match. */
|
* and we don't want to have the same extension (so "new.foo.sm" doesn't show up
|
||||||
return Dirname(sPath) + "new." + Basename(sPath);
|
* in *.sm). */
|
||||||
|
return Dirname(sPath) + "new." + Basename(sPath) + ".new";
|
||||||
}
|
}
|
||||||
|
|
||||||
RageFileObj *MakeFileObjDirect( CString sPath, int mode, RageFile &p, int &err )
|
RageFileObj *MakeFileObjDirect( CString sPath, int mode, RageFile &p, int &err )
|
||||||
|
|||||||
Reference in New Issue
Block a user