From 6820cc93ec82bc97e59fda2696f07b046e7006e0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 9 Nov 2009 16:08:17 +0000 Subject: refactor path delimiter in iar utils --- .../Avatar/Inventory/Archiver/InventoryArchiveUtils.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs index 7e72ca0..0fb5db2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs @@ -45,7 +45,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // Character used for escaping the path delimter ("\/") and itself ("\\") in human escaped strings public static readonly char ESCAPE_CHARACTER = '\\'; - public static readonly string PATH_DELIMITER = "/"; + + // The character used to separate inventory path components (different folders and items) + public static readonly char PATH_DELIMITER = '/'; /// /// Find a folder given a PATH_DELIMITER delimited path starting from a user's root folder @@ -110,10 +112,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver path = path.Trim(); - if (path == PATH_DELIMITER) + if (path == PATH_DELIMITER.ToString()) return startFolder; - string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); + string[] components = path.Split(new string[] { PATH_DELIMITER.ToString() }, 2, StringSplitOptions.None); InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); foreach (InventoryFolderBase folder in contents.Folders) @@ -244,7 +246,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } else { - if (PATH_DELIMITER == path[i].ToString() && !singleEscapeChar) + if (PATH_DELIMITER == path[i] && !singleEscapeChar) return new string[2] { path.Remove(i), path.Substring(i + 1) }; else singleEscapeChar = false; @@ -276,7 +278,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (singleEscapeChar) { - if (PATH_DELIMITER == path[i].ToString()) + if (PATH_DELIMITER == path[i]) sb.Append(PATH_DELIMITER); } else -- cgit v1.1