From 257ed4c4ac2026b39c90d9f58d505dc2721e8df3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 7 Aug 2009 23:05:16 +0100 Subject: [PATCH] Remove debugging output frm ini file loading. Make it collect matching files only from last path component. --- OpenSim/Framework/Util.cs | 18 ++++++++---------- .../Region/Application/ConfigurationLoader.cs | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 048de84fc2..bbb0ae2286 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1113,7 +1113,6 @@ namespace OpenSim.Framework public static string[] Glob(string path) { - m_log.DebugFormat("[GLOB]: Globbing {0}", path); string vol=String.Empty; if (Path.VolumeSeparatorChar != Path.DirectorySeparatorChar) @@ -1141,29 +1140,28 @@ namespace OpenSim.Framework List found = new List(); paths.Add(path); + int compIndex = -1; foreach (string c in comps) { + compIndex++; + List addpaths = new List(); foreach (string p in paths) { - m_log.DebugFormat("[GLOB]: Getting directories (wildcard: {0}) from path {1}", c, p); string[] dirs = Directory.GetDirectories(p, c); if (dirs.Length != 0) { foreach (string dir in dirs) - { - m_log.DebugFormat("[GLOB]: Adding path {0} to search list", Path.Combine(path, dir)); addpaths.Add(Path.Combine(path, dir)); - } } - m_log.DebugFormat("[GLOB]: Getting files (wildcard: {0}) from path {1}", c, p); - string[] files = Directory.GetFiles(p, c); - foreach (string f in files) + // Only add files if that is the last path component + if (compIndex == comps.Length - 1) { - m_log.DebugFormat("[GLOB]: Adding file {0} to result list", f); - found.Add(f); + string[] files = Directory.GetFiles(p, c); + foreach (string f in files) + found.Add(f); } } paths = addpaths; diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 3bdbc7d84e..3a6524275d 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -186,7 +186,6 @@ namespace OpenSim } else { - m_log.InfoFormat("Adding {0} to configuration", Path.Combine(Util.configDir(), file)); string basepath = Path.GetFullPath(Util.configDir()); string path = Path.Combine(basepath, file); string[] paths = Util.Glob(path);