1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

make excludes agnostic to trailing directory characters

This commit is contained in:
Kevin Glynn 2011-09-09 13:32:22 +02:00
parent 38a7bb85d6
commit aefe0f98c2

View File

@ -83,7 +83,10 @@ namespace Twiglet.CS2J.Translator
private static void addDirectories(IList<string> strs, string rawStr) {
string[] argDirs = rawStr.Split(';');
for (int i = 0; i < argDirs.Length; i++)
strs.Add(Path.GetFullPath(argDirs[i]));
{
string dir = Path.GetFullPath(argDirs[i]).TrimEnd(Path.DirectorySeparatorChar);
strs.Add(dir);
}
}
private static void addStrings(IList<string> strs, string rawStr) {
@ -277,7 +280,7 @@ namespace Twiglet.CS2J.Translator
{
string canonicalPath = Path.GetFullPath(root);
// If this is a directory, walk each file/dir in that directory
if (excludes == null || !excludes.Contains(canonicalPath))
if (excludes == null || !excludes.Contains(canonicalPath.TrimEnd(Path.DirectorySeparatorChar)))
{
if (Directory.Exists(canonicalPath))
{