diff options
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llfile.cpp | 4 | ||||
-rw-r--r-- | indra/llcommon/llfile.h | 2 | ||||
-rw-r--r-- | indra/llcommon/llinitparam.cpp | 7 | ||||
-rw-r--r-- | indra/llcommon/llinitparam.h | 1 | ||||
-rw-r--r-- | indra/llcommon/llsdparam.h | 1 | ||||
-rw-r--r-- | indra/llcommon/llsdserialize.cpp | 1 |
6 files changed, 12 insertions, 4 deletions
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp index 873a7bce25..7b559861bb 100644 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -239,7 +239,7 @@ int LLFile::close(LLFILE * file) } -int LLFile::remove(const std::string& filename) +int LLFile::remove(const std::string& filename, int supress_error) { #if LL_WINDOWS std::string utf8filename = filename; @@ -248,7 +248,7 @@ int LLFile::remove(const std::string& filename) #else int rc = ::remove(filename.c_str()); #endif - return warnif("remove", filename, rc); + return warnif("remove", filename, rc, supress_error); } int LLFile::rename(const std::string& filename, const std::string& newname) diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h index 3e25228aeb..d8f84daf2b 100644 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -72,7 +72,7 @@ public: static int mkdir(const std::string& filename, int perms = 0700); static int rmdir(const std::string& filename); - static int remove(const std::string& filename); + static int remove(const std::string& filename, int supress_error = 0); static int rename(const std::string& filename,const std::string& newname); static bool copy(const std::string from, const std::string to); diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index aa2f4eb289..1d104cf55d 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -193,7 +193,12 @@ namespace LLInitParam { if (!silent) { - p.parserWarning(llformat("Failed to parse parameter \"%s\"", p.getCurrentElementName().c_str())); + std::string file_name = p.getCurrentFileName(); + if(!file_name.empty()) + { + file_name = "in file: " + file_name; + } + p.parserWarning(llformat("Failed to parse parameter \"%s\" %s", p.getCurrentElementName().c_str(), file_name.c_str())); } return false; } diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index c65b05f610..f1f4226c40 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -551,6 +551,7 @@ namespace LLInitParam } virtual std::string getCurrentElementName() = 0; + virtual std::string getCurrentFileName() = 0; virtual void parserWarning(const std::string& message); virtual void parserError(const std::string& message); void setParseSilently(bool silent) { mParseSilently = silent; } diff --git a/indra/llcommon/llsdparam.h b/indra/llcommon/llsdparam.h index 09f1bdf1e3..93910b70ae 100644 --- a/indra/llcommon/llsdparam.h +++ b/indra/llcommon/llsdparam.h @@ -66,6 +66,7 @@ public: } /*virtual*/ std::string getCurrentElementName(); + /*virtual*/ std::string getCurrentFileName(){ return LLStringUtil::null; } private: void writeSDImpl(LLSD& sd, diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index d49ff0feb5..81ba8631c6 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -1200,6 +1200,7 @@ bool LLSDBinaryParser::parseString( read(istr, (char*)&value_nbo, sizeof(U32)); /*Flawfinder: ignore*/ S32 size = (S32)ntohl(value_nbo); if(mCheckLimits && (size > mMaxBytesLeft)) return false; + if(size < 0) return false; std::vector<char> buf; if(size) { |