diff options
Diffstat (limited to 'indra/llcommon')
| -rw-r--r-- | indra/llcommon/llassettype.cpp | 3 | ||||
| -rw-r--r-- | indra/llcommon/llassettype.h | 2 | ||||
| -rw-r--r-- | indra/llcommon/llerror.cpp | 29 |
3 files changed, 31 insertions, 3 deletions
diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index 4304db36be..7e5a157cdf 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -95,6 +95,7 @@ LLAssetDictionary::LLAssetDictionary() addEntry(LLAssetType::AT_MESH, new AssetEntry("MESH", "mesh", "mesh", false, false, false)); addEntry(LLAssetType::AT_WIDGET, new AssetEntry("WIDGET", "widget", "widget", false, false, false)); addEntry(LLAssetType::AT_PERSON, new AssetEntry("PERSON", "person", "person", false, false, false)); + addEntry(LLAssetType::AT_UNKNOWN, new AssetEntry("UNKNOWN", "invalid", NULL, false, false, false)); addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, FALSE, FALSE, FALSE)); }; @@ -156,7 +157,7 @@ LLAssetType::EType LLAssetType::lookup(const std::string& type_name) return iter->first; } } - return AT_NONE; + return AT_UNKNOWN; } // static diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index b849be9f16..79ab3d7efe 100644 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -130,7 +130,7 @@ public: // | 4. ADD TO LLViewerAssetType.cpp | // | 5. ADD TO DEFAULT_ASSET_FOR_INV in LLInventoryType.cpp | // +*********************************************************+ - + AT_UNKNOWN = 255, AT_NONE = -1 }; diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 29de79dc64..153bfab54c 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -899,6 +899,33 @@ namespace LLError namespace { + std::string sanitizeMessage(const std::string& message) + { + std::string message_new; + S32 len = message.length(); + for (S32 i = 0; i < len; i++) + { + char c = message[i]; + if (c == '\\') + { + message_new += "\\\\"; + } + else if (c == '\n') + { + message_new += "\\n"; + } + else if (c == '\r') + { + message_new += "\\r"; + } + else + { + message_new += c; + } + } + return message_new; + } + void writeToRecorders(const LLError::CallSite& site, const std::string& message, bool show_location = true, bool show_time = true, bool show_tags = true, bool show_level = true, bool show_function = true) { LLError::ELevel level = site.mLevel; @@ -937,7 +964,7 @@ namespace message_stream << site.mFunctionString << " "; } - message_stream << message; + message_stream << sanitizeMessage(message); r->recordMessage(level, message_stream.str()); } |
