Author: jonpryor
Date: 2005-09-07 08:33:05 -0400 (Wed, 07 Sep 2005)
New Revision: 49630

Modified:
   trunk/mcs/tools/mono-shlib-cop/ChangeLog
   trunk/mcs/tools/mono-shlib-cop/mono-shlib-cop.cs
Log:
        * mono-shlib-cop.cs: Patch from John Luke to fix use of Path.Combine 
(don't
          want to use an `/'-prefixed path as the 2nd parameter) and improve XML
          node selection.


Modified: trunk/mcs/tools/mono-shlib-cop/ChangeLog
===================================================================
--- trunk/mcs/tools/mono-shlib-cop/ChangeLog    2005-09-07 12:17:38 UTC (rev 
49629)
+++ trunk/mcs/tools/mono-shlib-cop/ChangeLog    2005-09-07 12:33:05 UTC (rev 
49630)
@@ -1,3 +1,9 @@
+2005-09-07  Jonathan Pryor  <[EMAIL PROTECTED]>
+
+       * mono-shlib-cop.cs: Patch from John Luke to fix use of Path.Combine 
(don't
+         want to use an `/'-prefixed path as the 2nd parameter) and improve XML
+         node selection.
+
 2005-07-18  Jonathan Pryor  <[EMAIL PROTECTED]>
 
        * mono-shlib-cop.exe.config: .config file to help with testing.

Modified: trunk/mcs/tools/mono-shlib-cop/mono-shlib-cop.cs
===================================================================
--- trunk/mcs/tools/mono-shlib-cop/mono-shlib-cop.cs    2005-09-07 12:17:38 UTC 
(rev 49629)
+++ trunk/mcs/tools/mono-shlib-cop/mono-shlib-cop.cs    2005-09-07 12:33:05 UTC 
(rev 49630)
@@ -187,25 +187,24 @@
                        mono_configs = new XmlDocument [prefixes.Length];
                        for (int i = 0; i < mono_configs.Length; ++i) {
                                mono_configs [i] = new XmlDocument ();
-                               mono_configs [i].Load (Path.Combine (prefixes 
[i], "/etc/mono/config"));
+                               mono_configs [i].Load (Path.Combine (prefixes 
[i], "etc/mono/config"));
                        }
                }
 
                public string GetDllmapEntry (string assemblyPath, string 
library)
                {
-                       string xpath = "//[EMAIL PROTECTED]"" + library + "\"]";
+                       string xpath = "/configuration/[EMAIL PROTECTED]"" + 
library + "\"]";
 
                        XmlDocument d = GetAssemblyConfig (assemblyPath);
                        if (d != null) {
-                               XmlNodeList maps = d.SelectNodes (xpath);
-                               if (maps.Count > 0)
-                                       return maps [0].Attributes 
["target"].Value;
+                               XmlNode map = d.SelectSingleNode (xpath);
+                               if (map != null)
+                                       return map.Attributes ["target"].Value;
                        }
                        foreach (XmlDocument config in mono_configs) {
-                               XmlNodeList maps = config.SelectNodes (xpath);
-                               Trace.WriteLine (string.Format ("{0} <dllmap/> 
entries found!", maps.Count));
-                               if (maps.Count > 0)
-                                       return maps [0].Attributes 
["target"].Value;
+                               XmlNode map = config.SelectSingleNode (xpath);
+                               if (map != null)
+                                       return map.Attributes ["target"].Value;
                        }
                        return null;
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to