summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2010-12-15 15:47:09 -0800
committerDon Kjer <don@lindenlab.com>2010-12-15 15:47:09 -0800
commitb0ee1c818aa779edbb57f70b723132ce8d7347f7 (patch)
tree3bc9bac8b1403e0eb6eb7be7d7f07d4946f2ce8c /indra/newview/llpreviewscript.cpp
parentc3958f75d2ef6c998d99e8e97e76e4de0468ecef (diff)
parent3e1f2083abe31d54b4b57ac7e8479b79461f6062 (diff)
Merge from don_linden/viewer-sandbox
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r--indra/newview/llpreviewscript.cpp12
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,