X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMicrosoft.Build.Engine%2FMicrosoft.Build.BuildEngine%2FConditionFunctionExpression.cs;h=1b532c38d9622e80bf868c633e6db612bc18c24a;hb=9d28791c5a0ad19894636d0b2423b179d8af16d9;hp=ae2bead1a576ef6772870b62a0293621a31e192d;hpb=ab0378bf54a107c3e7f9b38f3f5f2357172e1ced;p=mono.git diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFunctionExpression.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFunctionExpression.cs index ae2bead1a57..1b532c38d96 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFunctionExpression.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFunctionExpression.cs @@ -46,7 +46,7 @@ namespace Microsoft.Build.BuildEngine { Type t = typeof (ConditionFunctionExpression); string [] names = new string [] { "Exists", "HasTrailingSlash" }; - functions = new Dictionary (); + functions = new Dictionary (StringComparer.InvariantCultureIgnoreCase); foreach (string name in names) functions.Add (name, t.GetMethod (name, BindingFlags.NonPublic | BindingFlags.Static)); } @@ -60,10 +60,10 @@ namespace Microsoft.Build.BuildEngine { public override bool BoolEvaluate (Project context) { if (!functions.ContainsKey (name)) - throw new InvalidOperationException (); + throw new InvalidOperationException ("Unknown function named: " + name); if (functions [name] == null) - throw new InvalidOperationException (); + throw new InvalidOperationException ("Unknown function named: " + name); MethodInfo mi = functions [name]; object [] argsArr = new object [args.Count + 1]; @@ -113,7 +113,7 @@ namespace Microsoft.Build.BuildEngine { if (!Path.IsPathRooted (file) && directory != null && directory != String.Empty) file = Path.Combine (directory, file); - return File.Exists (file); + return File.Exists (file) || Directory.Exists (file); } static bool HasTrailingSlash (string file, Project context)