Output: Sanitize C# filenames for invalid characters
This commit is contained in:
@@ -263,6 +263,10 @@ namespace Il2CppInspector.Outputs
|
|||||||
if (!string.IsNullOrEmpty(Path.GetDirectoryName(outFile)))
|
if (!string.IsNullOrEmpty(Path.GetDirectoryName(outFile)))
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(outFile));
|
Directory.CreateDirectory(Path.GetDirectoryName(outFile));
|
||||||
|
|
||||||
|
// Sanitize leafname (might be class name with invalid characters)
|
||||||
|
var leafname = Regex.Replace(Path.GetFileName(outFile), @"[<>:""\|\?\*]", "_");
|
||||||
|
outFile = Path.GetDirectoryName(outFile) + Path.DirectorySeparatorChar + leafname;
|
||||||
|
|
||||||
// Create output file
|
// Create output file
|
||||||
bool fileWritten = false;
|
bool fileWritten = false;
|
||||||
do {
|
do {
|
||||||
|
|||||||
Reference in New Issue
Block a user