diff options
author | Marck | 2010-08-10 16:07:21 +0200 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-08-13 23:59:30 +0100 |
commit | ae43a07f3bf5bd91e4ae7ed9b82c44d610b72044 (patch) | |
tree | 20d04b0424dd9ccad741d5fc1ec11895ebad166e | |
parent | Updated the create_region command in the RemoteAdmin plugin to properly suppo... (diff) | |
download | opensim-SC_OLD-ae43a07f3bf5bd91e4ae7ed9b82c44d610b72044.zip opensim-SC_OLD-ae43a07f3bf5bd91e4ae7ed9b82c44d610b72044.tar.gz opensim-SC_OLD-ae43a07f3bf5bd91e4ae7ed9b82c44d610b72044.tar.bz2 opensim-SC_OLD-ae43a07f3bf5bd91e4ae7ed9b82c44d610b72044.tar.xz |
Configuration files can read include files from relative paths.
-rw-r--r-- | OpenSim/Region/Application/ConfigurationLoader.cs | 12 | ||||
-rw-r--r-- | OpenSim/Tools/Configger/ConfigurationLoader.cs | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 09f7bea..e69e3fc 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs | |||
@@ -211,7 +211,17 @@ namespace OpenSim | |||
211 | else | 211 | else |
212 | { | 212 | { |
213 | string basepath = Path.GetFullPath(Util.configDir()); | 213 | string basepath = Path.GetFullPath(Util.configDir()); |
214 | string path = Path.Combine(basepath, file); | 214 | // Resolve relative paths with wildcards |
215 | string chunkWithoutWildcards = file; | ||
216 | string chunkWithWildcards = string.Empty; | ||
217 | int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' }); | ||
218 | if (wildcardIndex != -1) | ||
219 | { | ||
220 | chunkWithoutWildcards = file.Substring(0, wildcardIndex); | ||
221 | chunkWithWildcards = file.Substring(wildcardIndex); | ||
222 | } | ||
223 | string path = Path.Combine(basepath, chunkWithoutWildcards); | ||
224 | path = Path.GetFullPath(path) + chunkWithWildcards; | ||
215 | string[] paths = Util.Glob(path); | 225 | string[] paths = Util.Glob(path); |
216 | foreach (string p in paths) | 226 | foreach (string p in paths) |
217 | { | 227 | { |
diff --git a/OpenSim/Tools/Configger/ConfigurationLoader.cs b/OpenSim/Tools/Configger/ConfigurationLoader.cs index e74debb..8e71b42 100644 --- a/OpenSim/Tools/Configger/ConfigurationLoader.cs +++ b/OpenSim/Tools/Configger/ConfigurationLoader.cs | |||
@@ -141,7 +141,17 @@ namespace OpenSim.Tools.Configger | |||
141 | else | 141 | else |
142 | { | 142 | { |
143 | string basepath = Path.GetFullPath("."); | 143 | string basepath = Path.GetFullPath("."); |
144 | string path = Path.Combine(basepath, file); | 144 | // Resolve relative paths with wildcards |
145 | string chunkWithoutWildcards = file; | ||
146 | string chunkWithWildcards = string.Empty; | ||
147 | int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' }); | ||
148 | if (wildcardIndex != -1) | ||
149 | { | ||
150 | chunkWithoutWildcards = file.Substring(0, wildcardIndex); | ||
151 | chunkWithWildcards = file.Substring(wildcardIndex); | ||
152 | } | ||
153 | string path = Path.Combine(basepath, chunkWithoutWildcards); | ||
154 | path = Path.GetFullPath(path) + chunkWithWildcards; | ||
145 | string[] paths = Util.Glob(path); | 155 | string[] paths = Util.Glob(path); |
146 | foreach (string p in paths) | 156 | foreach (string p in paths) |
147 | { | 157 | { |