diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-12-16 11:12:15 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-12-16 11:12:15 -0500 |
commit | ee0055f5af672bef8402679fe8cc41717b0b9678 (patch) | |
tree | d2c025aa4d9469d98a0c8544e1634eedfbad0c84 /indra/newview/llpreviewscript.cpp | |
parent | ad625861e120cae967d6bc60a9c1f4d86f4c2ed1 (diff) | |
parent | 73962e2134035855def0177db171d8eddaa193cb (diff) |
Automated merge up from viewer-development
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r-- | indra/newview/llpreviewscript.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 330e809c53..d0ebf047e8 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -2034,7 +2034,17 @@ bool LLLiveLSLEditor::writeToFile(const std::string& filename) std::string LLLiveLSLEditor::getTmpFileName() { - return std::string(LLFile::tmpdir()) + "sl_script_" + mObjectUUID.asString() + ".lsl"; + // Take script inventory item id (within the object inventory) + // to consideration so that it's possible to edit multiple scripts + // in the same object inventory simultaneously (STORM-781). + std::string script_id = mObjectUUID.asString() + "_" + mItemUUID.asString(); + + // Use MD5 sum to make the file name shorter and not exceed maximum path length. + char script_id_hash_str[33]; /* Flawfinder: ignore */ + LLMD5 script_id_hash((const U8 *)script_id.c_str()); + script_id_hash.hex_digest(script_id_hash_str); + + return std::string(LLFile::tmpdir()) + "sl_script_" + script_id_hash_str + ".lsl"; } void LLLiveLSLEditor::uploadAssetViaCaps(const std::string& url, |