Remove debugging output frm ini file loading. Make it collect matching
files only from last path component.arthursv
parent
a1a09297bc
commit
257ed4c4ac
|
@ -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,28 +1140,27 @@ namespace OpenSim.Framework
|
|||
List<string> found = new List<string>();
|
||||
paths.Add(path);
|
||||
|
||||
int compIndex = -1;
|
||||
foreach (string c in comps)
|
||||
{
|
||||
compIndex++;
|
||||
|
||||
List<string> addpaths = new List<string>();
|
||||
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);
|
||||
// Only add files if that is the last path component
|
||||
if (compIndex == comps.Length - 1)
|
||||
{
|
||||
string[] files = Directory.GetFiles(p, c);
|
||||
foreach (string f in files)
|
||||
{
|
||||
m_log.DebugFormat("[GLOB]: Adding file {0} to result list", f);
|
||||
found.Add(f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue