mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Configuration files can read include files from relative paths.
This commit is contained in:
committed by
Justin Clark-Casey (justincc)
parent
8eeb3f2fd2
commit
ae43a07f3b
@@ -211,7 +211,17 @@ namespace OpenSim
|
||||
else
|
||||
{
|
||||
string basepath = Path.GetFullPath(Util.configDir());
|
||||
string path = Path.Combine(basepath, file);
|
||||
// Resolve relative paths with wildcards
|
||||
string chunkWithoutWildcards = file;
|
||||
string chunkWithWildcards = string.Empty;
|
||||
int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' });
|
||||
if (wildcardIndex != -1)
|
||||
{
|
||||
chunkWithoutWildcards = file.Substring(0, wildcardIndex);
|
||||
chunkWithWildcards = file.Substring(wildcardIndex);
|
||||
}
|
||||
string path = Path.Combine(basepath, chunkWithoutWildcards);
|
||||
path = Path.GetFullPath(path) + chunkWithWildcards;
|
||||
string[] paths = Util.Glob(path);
|
||||
foreach (string p in paths)
|
||||
{
|
||||
|
||||
@@ -141,7 +141,17 @@ namespace OpenSim.Tools.Configger
|
||||
else
|
||||
{
|
||||
string basepath = Path.GetFullPath(".");
|
||||
string path = Path.Combine(basepath, file);
|
||||
// Resolve relative paths with wildcards
|
||||
string chunkWithoutWildcards = file;
|
||||
string chunkWithWildcards = string.Empty;
|
||||
int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' });
|
||||
if (wildcardIndex != -1)
|
||||
{
|
||||
chunkWithoutWildcards = file.Substring(0, wildcardIndex);
|
||||
chunkWithWildcards = file.Substring(wildcardIndex);
|
||||
}
|
||||
string path = Path.Combine(basepath, chunkWithoutWildcards);
|
||||
path = Path.GetFullPath(path) + chunkWithWildcards;
|
||||
string[] paths = Util.Glob(path);
|
||||
foreach (string p in paths)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user