refactor: make human iar escape char a constant rather than a magic char

0.6.8-post-fixes
Justin Clark-Casey (justincc) 2009-11-09 15:54:43 +00:00
parent 668850b974
commit 9b2592a960
1 changed files with 5 additions and 3 deletions

View File

@ -43,6 +43,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 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 = "/"; public static readonly string PATH_DELIMITER = "/";
/// <summary> /// <summary>
@ -236,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
for (int i = 0; i < path.Length; i++) for (int i = 0; i < path.Length; i++)
{ {
if (path[i] == '\\' && !singleEscapeChar) if (path[i] == ESCAPE_CHARACTER && !singleEscapeChar)
{ {
singleEscapeChar = true; singleEscapeChar = true;
} }
@ -267,7 +269,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
bool singleEscapeChar = false; bool singleEscapeChar = false;
for (int i = 0; i < path.Length; i++) for (int i = 0; i < path.Length; i++)
{ {
if (path[i] == '\\' && !singleEscapeChar) if (path[i] == ESCAPE_CHARACTER && !singleEscapeChar)
singleEscapeChar = true; singleEscapeChar = true;
else else
singleEscapeChar = false; singleEscapeChar = false;