diff options
author | Dr Scofield | 2009-05-27 17:34:06 +0000 |
---|---|---|
committer | Dr Scofield | 2009-05-27 17:34:06 +0000 |
commit | 9e37e291b0cb8e88b1cd72d3644aec4159b6f3bd (patch) | |
tree | 12eef9e5c42f3d1130c1b092e0514f6cded0fbe3 /OpenSim/Framework/Serialization | |
parent | Adding the GlynnTucker cache module as the default choice in .ini's. (diff) | |
download | opensim-SC_OLD-9e37e291b0cb8e88b1cd72d3644aec4159b6f3bd.zip opensim-SC_OLD-9e37e291b0cb8e88b1cd72d3644aec4159b6f3bd.tar.gz opensim-SC_OLD-9e37e291b0cb8e88b1cd72d3644aec4159b6f3bd.tar.bz2 opensim-SC_OLD-9e37e291b0cb8e88b1cd72d3644aec4159b6f3bd.tar.xz |
making TarArchiveReader more resilient when faced with OARs created by
ancient tars.
Diffstat (limited to 'OpenSim/Framework/Serialization')
-rw-r--r-- | OpenSim/Framework/Serialization/TarArchiveReader.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Framework/Serialization/TarArchiveReader.cs b/OpenSim/Framework/Serialization/TarArchiveReader.cs index da5703f..1088870 100644 --- a/OpenSim/Framework/Serialization/TarArchiveReader.cs +++ b/OpenSim/Framework/Serialization/TarArchiveReader.cs | |||
@@ -63,7 +63,11 @@ namespace OpenSim.Framework.Serialization | |||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Used to trim off null chars | 64 | /// Used to trim off null chars |
65 | /// </summary> | 65 | /// </summary> |
66 | protected char[] m_nullCharArray = new char[] { '\0' }; | 66 | protected static char[] m_nullCharArray = new char[] { '\0' }; |
67 | /// <summary> | ||
68 | /// Used to trim off space chars | ||
69 | /// </summary> | ||
70 | protected static char[] m_spaceCharArray = new char[] { ' ' }; | ||
67 | 71 | ||
68 | /// <summary> | 72 | /// <summary> |
69 | /// Generate a tar reader which reads from the given stream. | 73 | /// Generate a tar reader which reads from the given stream. |
@@ -195,7 +199,9 @@ namespace OpenSim.Framework.Serialization | |||
195 | /// <returns></returns> | 199 | /// <returns></returns> |
196 | public static int ConvertOctalBytesToDecimal(byte[] bytes, int startIndex, int count) | 200 | public static int ConvertOctalBytesToDecimal(byte[] bytes, int startIndex, int count) |
197 | { | 201 | { |
198 | string oString = m_asciiEncoding.GetString(bytes, startIndex, count); | 202 | // Trim leading white space: ancient tars do that instead |
203 | // of leading 0s :-( don't ask. really. | ||
204 | string oString = m_asciiEncoding.GetString(bytes, startIndex, count).TrimStart(m_spaceCharArray); | ||
199 | 205 | ||
200 | int d = 0; | 206 | int d = 0; |
201 | 207 | ||