FPaths::CreateTempFilename adds unnecessary path separator

FString FPaths::CreateTempFilename( const TCHAR* Path, const TCHAR* Prefix, const TCHAR* Extension )
{
// … SNIP …
if( PathLen > 0 && Path[ PathLen - 1 ] != TEXT(’/’) )
{
UniqueFilename = FString::Printf( TEXT("%s/%s%s%s"), Path, Prefix, *FGuid::NewGuid().ToString(), Extension );
}
else
{
UniqueFilename = FString::Printf( TEXT("%s/%s%s%s"), Path, Prefix, *FGuid::NewGuid().ToString(), Extension );
}
// … SNIP …
}

Note that both the if and the else use the same format string, so even if Path ends with a /, the returned filename will be in the form Path//PrefixGUIDExtension.

Good catch! I refactored the inner loop to a more readable and cross-platform…

UniqueFilename = FPaths::Combine(Path, *FString::Printf(TEXT("%s%s%s"), Prefix, *FGuid::NewGuid().ToString(), Extension));

Will be in the next Github update and/or 4.2 release.

Great, thanks!