summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-08-20 14:48:00 -0700
committerLeyla Farazha <leyla@lindenlab.com>2010-08-20 14:48:00 -0700
commit5fab3253f941c0e25b4b86e29ab7a34c4325f825 (patch)
tree8c79b64a284d18a2e316ee3fc881629dff35617d /indra/llcommon
parentab320a12e62152907bbec150972a9ac8a0e244fb (diff)
parentcde71ddc88293a752787b710f6d03aba1ec0b15e (diff)
Merge from dessie/viewer-release
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llapr.cpp12
-rw-r--r--indra/llcommon/lldate.cpp7
-rw-r--r--indra/llcommon/llstring.cpp6
-rw-r--r--indra/llcommon/llversionserver.h2
4 files changed, 23 insertions, 4 deletions
diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp
index 7330b00bcf..dca4cf7c3f 100644
--- a/indra/llcommon/llapr.cpp
+++ b/indra/llcommon/llapr.cpp
@@ -417,7 +417,11 @@ apr_pool_t* LLAPRFile::getAPRFilePool(apr_pool_t* pool)
// File I/O
S32 LLAPRFile::read(void *buf, S32 nbytes)
{
- llassert_always(mFile) ;
+ if(!mFile)
+ {
+ llwarns << "apr mFile is removed by somebody else. Can not read." << llendl ;
+ return 0;
+ }
apr_size_t sz = nbytes;
apr_status_t s = apr_file_read(mFile, buf, &sz);
@@ -435,7 +439,11 @@ S32 LLAPRFile::read(void *buf, S32 nbytes)
S32 LLAPRFile::write(const void *buf, S32 nbytes)
{
- llassert_always(mFile) ;
+ if(!mFile)
+ {
+ llwarns << "apr mFile is removed by somebody else. Can not write." << llendl ;
+ return 0;
+ }
apr_size_t sz = nbytes;
apr_status_t s = apr_file_write(mFile, buf, &sz);
diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp
index a7ef28b431..04583cdd4a 100644
--- a/indra/llcommon/lldate.cpp
+++ b/indra/llcommon/lldate.cpp
@@ -121,7 +121,12 @@ std::string LLDate::toHTTPDateString (tm * gmt, std::string fmt)
// use strftime() as it appears to be faster than std::time_put
char buffer[128];
strftime(buffer, 128, fmt.c_str(), gmt);
- return std::string(buffer);
+ std::string res(buffer);
+#if LL_WINDOWS
+ // Convert from locale-dependant charset to UTF-8 (EXT-8524).
+ res = ll_convert_string_to_utf8_string(res);
+#endif
+ return res;
}
void LLDate::toStream(std::ostream& s) const
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 2d391839ef..df234c2f00 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -761,6 +761,7 @@ void LLStringOps::setupDatetimeInfo (bool daylight)
datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31
+ datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02
@@ -1130,6 +1131,11 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
replacement = LLStringOps::sDayFormat;
LLStringUtil::format(replacement, args);
}
+ else if (code == "%-d")
+ {
+ struct tm * gmt = gmtime (&loc_seconds);
+ replacement = llformat ("%d", gmt->tm_mday); // day of the month without leading zero
+ }
else if( !LLStringOps::sAM.empty() && !LLStringOps::sPM.empty() && code == "%p" )
{
struct tm * gmt = gmtime (&loc_seconds);
diff --git a/indra/llcommon/llversionserver.h b/indra/llcommon/llversionserver.h
index 87fe7001e0..ddda9fb6af 100644
--- a/indra/llcommon/llversionserver.h
+++ b/indra/llcommon/llversionserver.h
@@ -36,7 +36,7 @@
const S32 LL_VERSION_MAJOR = 2;
const S32 LL_VERSION_MINOR = 1;
const S32 LL_VERSION_PATCH = 0;
-const S32 LL_VERSION_BUILD = 0;
+const S32 LL_VERSION_BUILD = 13828;
const char * const LL_CHANNEL = "Second Life Server";