refactor: make human iar escape char a constant rather than a magic char
parent
668850b974
commit
9b2592a960
|
@ -42,7 +42,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
public static class InventoryArchiveUtils
|
public static class InventoryArchiveUtils
|
||||||
{
|
{
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue