diff --git a/indra/newview/fscommon.cpp b/indra/newview/fscommon.cpp index d064dcdac6..a1bba035e0 100644 --- a/indra/newview/fscommon.cpp +++ b/indra/newview/fscommon.cpp @@ -85,6 +85,17 @@ bool is_irc_me_prefix(const std::string& text) return (prefix == "/me " || prefix == "/me'"); } +std::string unescape_name(const std::string& name) +{ + // bugfix for SL-46920: preventing filenames that break stuff. + char * curl_str = curl_unescape(name.c_str(), name.size()); + std::string unescaped_name(curl_str); + curl_free(curl_str); + curl_str = NULL; + + return unescaped_name; +} + std::string FSCommon::applyAutoCloseOoc(std::string message) { if (!gSavedSettings.getBOOL("AutoCloseOOC")) diff --git a/indra/newview/fscommon.h b/indra/newview/fscommon.h index 5d00a2887c..be33ef6790 100644 --- a/indra/newview/fscommon.h +++ b/indra/newview/fscommon.h @@ -40,6 +40,7 @@ const F32 AVATAR_UNKNOWN_RANGE = -1.f; void report_to_nearby_chat(const std::string& message); std::string format_string(std::string text, const LLStringUtil::format_map_t& args); bool is_irc_me_prefix(const std::string& text); +std::string unescape_name(const std::string& name); namespace FSCommon { diff --git a/indra/newview/lggbeammaps.cpp b/indra/newview/lggbeammaps.cpp index 9ff3602757..c027275eea 100644 --- a/indra/newview/lggbeammaps.cpp +++ b/indra/newview/lggbeammaps.cpp @@ -13,6 +13,7 @@ #include "llviewerprecompiledheaders.h" +#include "fscommon.h" #include "lggbeammaps.h" #include "lggbeamscolors.h" #include "llagent.h" @@ -27,17 +28,6 @@ lggBeamMaps gLggBeamMaps; -std::string unescape_name(const std::string& name) -{ - // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_unescape(name.c_str(), name.size()); - std::string unescaped_name(curl_str); - curl_free(curl_str); - curl_str = NULL; - - return unescaped_name; -} - F32 hueToRgb(F32 val1In, F32 val2In, F32 valHUeIn) { while (valHUeIn < 0.0f) @@ -70,7 +60,7 @@ F32 hueToRgb(F32 val1In, F32 val2In, F32 valHUeIn) void hslToRgb(F32 hValIn, F32 sValIn, F32 lValIn, F32& rValOut, F32& gValOut, F32& bValOut) { - if (sValIn < 0.00001f) + if (sValIn < F_ALMOST_ZERO) { rValOut = lValIn; gValOut = lValIn; @@ -400,4 +390,3 @@ void lggBeamMaps::updateBeamChat(const LLVector3d& currentPos) } } } - diff --git a/indra/newview/lggbeamscolors.cpp b/indra/newview/lggbeamscolors.cpp index 0da2aa0b5f..78513dd73e 100644 --- a/indra/newview/lggbeamscolors.cpp +++ b/indra/newview/lggbeamscolors.cpp @@ -18,9 +18,6 @@ #include "llviewerprecompiledheaders.h" #include "lggbeamscolors.h" -#include "llfile.h" -#include "llsdserialize.h" - lggBeamsColors lggBeamsColors::fromLLSD(const LLSD& inputData) { lggBeamsColors toReturn; diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index df4ccb7a21..461e84a574 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -69,6 +69,7 @@ // [RLVa:KB] - Checked: RLVa-2.4 (@setenv) #include "rlvactions.h" // [/RLVa:KB] +#include "fscommon.h" //========================================================================= namespace @@ -828,7 +829,6 @@ LLEnvironment::LLEnvironment(): } // OpenSim legacy Windlight setting support #ifdef OPENSIM -std::string unescape_name(const std::string& name); void LLEnvironment::loadLegacyPresets() { // [EEPMERGE] diff --git a/indra/newview/quickprefs.cpp b/indra/newview/quickprefs.cpp index 65b3e20733..d787bef23a 100644 --- a/indra/newview/quickprefs.cpp +++ b/indra/newview/quickprefs.cpp @@ -58,7 +58,6 @@ #include "llvoavatarself.h" #include "rlvhandler.h" -std::string unescape_name(const std::string& name); class FSSettingsCollector : public LLInventoryCollectFunctor { public: