mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-08 18:06:41 +00:00
Attempt to avoid input file overwriting
This commit is contained in:
@@ -14,10 +14,9 @@ namespace SabreTools.Wrappers
|
||||
if (string.IsNullOrEmpty(outputPath))
|
||||
{
|
||||
string outputFilename = Filename is null
|
||||
? Guid.NewGuid().ToString()
|
||||
: Path.GetFileName(Filename);
|
||||
outputFilename += ".a78";
|
||||
outputPath = Path.Combine(outputPath, outputFilename);
|
||||
? (Guid.NewGuid().ToString() + ".a78")
|
||||
: (Filename + ".new");
|
||||
outputPath = Path.GetFullPath(outputFilename);
|
||||
}
|
||||
|
||||
// Check for invalid data
|
||||
|
||||
@@ -14,10 +14,9 @@ namespace SabreTools.Wrappers
|
||||
if (string.IsNullOrEmpty(outputPath))
|
||||
{
|
||||
string outputFilename = Filename is null
|
||||
? Guid.NewGuid().ToString()
|
||||
: Path.GetFileName(Filename);
|
||||
outputFilename += "lnx";
|
||||
outputPath = Path.Combine(outputPath, outputFilename);
|
||||
? (Guid.NewGuid().ToString() + ".lnx")
|
||||
: (Filename + ".new");
|
||||
outputPath = Path.GetFullPath(outputFilename);
|
||||
}
|
||||
|
||||
// Check for invalid data
|
||||
|
||||
Reference in New Issue
Block a user