Add file length check on MergeDiff

This commit is contained in:
Matt Nadareski
2016-05-17 10:46:49 -07:00
parent 17a2480f03
commit c1c9072649

View File

@@ -1529,14 +1529,28 @@ Make a selection:
if (Directory.Exists(input.Replace("\"", ""))) if (Directory.Exists(input.Replace("\"", "")))
{ {
foreach (string file in Directory.EnumerateFiles(input.Replace("\"", ""), "*", SearchOption.AllDirectories)) foreach (string file in Directory.EnumerateFiles(input.Replace("\"", ""), "*", SearchOption.AllDirectories))
{
try
{ {
newInputs.Add(Path.GetFullPath(file)); newInputs.Add(Path.GetFullPath(file));
} }
catch (PathTooLongException)
{
logger.Warning("The path for " + file + " was too long");
}
}
} }
else if (File.Exists(input.Replace("\"", ""))) else if (File.Exists(input.Replace("\"", "")))
{
try
{ {
newInputs.Add(Path.GetFullPath(input.Replace("\"", ""))); newInputs.Add(Path.GetFullPath(input.Replace("\"", "")));
} }
catch (PathTooLongException)
{
logger.Warning("The path for " + input.Replace("\"", "") + " was too long");
}
}
} }
MergeDiff md = new MergeDiff(newInputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old, logger); MergeDiff md = new MergeDiff(newInputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old, logger);