From 9b2592a9609edffb132138ce96537f5c7de1a024 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 9 Nov 2009 15:54:43 +0000 Subject: refactor: make human iar escape char a constant rather than a magic char --- .../Avatar/Inventory/Archiver/InventoryArchiveUtils.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs index e297c37..5c31c26 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs @@ -42,7 +42,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver public static class InventoryArchiveUtils { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + + // 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 = "/"; /// @@ -236,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver for (int i = 0; i < path.Length; i++) { - if (path[i] == '\\' && !singleEscapeChar) + if (path[i] == ESCAPE_CHARACTER && !singleEscapeChar) { singleEscapeChar = true; } @@ -267,7 +269,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver bool singleEscapeChar = false; for (int i = 0; i < path.Length; i++) { - if (path[i] == '\\' && !singleEscapeChar) + if (path[i] == ESCAPE_CHARACTER && !singleEscapeChar) singleEscapeChar = true; else singleEscapeChar = false; -- cgit v1.1