Skip to content

Commit

Permalink
try to fix issues with paths on windows for games with trailing dots
Browse files Browse the repository at this point in the history
  • Loading branch information
13xforever committed Nov 20, 2021
1 parent 72e9043 commit 27de662
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Ps3DiscDumper/Dumper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Ps3DiscDumper
{
public class Dumper: IDisposable
{
public const string Version = "3.1.0";
public const string Version = "3.1.1";

private static readonly HashSet<char> InvalidChars = new HashSet<char>(Path.GetInvalidFileNameChars());
private static readonly char[] MultilineSplit = {'\r', '\n'};
Expand Down Expand Up @@ -228,7 +228,10 @@ public void DetectDisc(string inDir = "", Func<Dumper, string> outputDirFormatte
TotalFileSize = totalFilesize;
TotalFileCount = DiscFilenames.Count;

OutputDir = new string(outputDirFormatter(this).ToCharArray().Where(c => !InvalidChars.Contains(c)).ToArray());
var path = new string(outputDirFormatter(this).ToCharArray().Where(c => !InvalidChars.Contains(c)).ToArray());
var separators = new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
var pathParts = path.Split(separators, StringSplitOptions.RemoveEmptyEntries).Select(p => p.TrimEnd('.'));
OutputDir = string.Join(Path.DirectorySeparatorChar, pathParts);
Log.Debug($"Output: {OutputDir}");
}

Expand Down

0 comments on commit 27de662

Please sign in to comment.