From 75e76ea248ae4674afa7ab2e3e2a018228073dc3 Mon Sep 17 00:00:00 2001
From: Vadim Savchuk <vsavchuk@productengine.com>
Date: Wed, 4 Aug 2010 16:52:22 +0300
Subject: EXT-8524 FIXED Non-ASCII character corruption in date.

Convert formatted date from system charset to UTF-8 on Windows (other OSes don't require this).

See http://jira.secondlife.com/browse/EXT-8318 for more details.

Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/834/

--HG--
branch : product-engine
---
 indra/llcommon/lldate.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'indra/llcommon')

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
-- 
cgit v1.2.3


From 06b26d0dfa1a3699db20abc09312b4f04056f0ca Mon Sep 17 00:00:00 2001
From: Vadim Savchuk <vsavchuk@productengine.com>
Date: Wed, 4 Aug 2010 16:52:22 +0300
Subject: EXT-8524 FIXED Non-ASCII character corruption in date.

Convert formatted date from system charset to UTF-8 on Windows (other OSes don't require this).

See http://jira.secondlife.com/browse/EXT-8318 for more details.

Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/834/
---
 indra/llcommon/lldate.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'indra/llcommon')

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
-- 
cgit v1.2.3


From 46334b6310ca76fea0f712b2e9dd1084af387f25 Mon Sep 17 00:00:00 2001
From: Vadim Savchuk <vsavchuk@productengine.com>
Date: Thu, 5 Aug 2010 15:57:19 +0300
Subject: EXT-8309 FIXED Incorrect French date format in place profile and
 status bar.

Changes:
- Added support for formatting day of the month without leading zero ("sday").
- Changed date format in place profile (landmark info) and in the top status bar
  according to bug reporter's request.

Technical details:
Actually implementation of strftime() in Linux and Windows supports stripping the
leading zero (with "%-d" and "%#d" respectively).
But that's not supported in MacOSX, so I had to reimplement it.

Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/842/

--HG--
branch : product-engine
---
 indra/llcommon/llstring.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'indra/llcommon')

diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 2693c0e22b..faf7aa51f1 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -758,6 +758,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
@@ -1127,6 +1128,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);
-- 
cgit v1.2.3


From b103141506534b08543fe1d135764a613e6d0c8b Mon Sep 17 00:00:00 2001
From: Vadim Savchuk <vsavchuk@productengine.com>
Date: Thu, 5 Aug 2010 15:57:19 +0300
Subject: EXT-8309 FIXED Incorrect French date format in place profile and
 status bar.

Changes:
- Added support for formatting day of the month without leading zero ("sday").
- Changed date format in place profile (landmark info) and in the top status bar
  according to bug reporter's request.

Technical details:
Actually implementation of strftime() in Linux and Windows supports stripping the
leading zero (with "%-d" and "%#d" respectively).
But that's not supported in MacOSX, so I had to reimplement it.

Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/842/
---
 indra/llcommon/llstring.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'indra/llcommon')

diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 2693c0e22b..faf7aa51f1 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -758,6 +758,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
@@ -1127,6 +1128,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);
-- 
cgit v1.2.3


From 4682264eadc3c3a4dc09e64fc5ad74cb0657639e Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Fri, 6 Aug 2010 09:29:33 -0600
Subject: EXT-8447: FIXED: crash at
 LLTextureCache::writeEntryToHeaderImmediately(int,LLTextureCache::Entry
 &,bool) [secondlife-bin lltexturecache.cpp]

---
 indra/llcommon/llapr.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'indra/llcommon')

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);
-- 
cgit v1.2.3


From fd3891ead58389121c69fec2106a9f30ed48b88c Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Fri, 6 Aug 2010 09:29:33 -0600
Subject: EXT-8447: FIXED: crash at
 LLTextureCache::writeEntryToHeaderImmediately(int,LLTextureCache::Entry
 &,bool) [secondlife-bin lltexturecache.cpp]

---
 indra/llcommon/llapr.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'indra/llcommon')

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);
-- 
cgit v1.2.3


From 67d1837ce755b8a8cceb3c60d16976c5381d2546 Mon Sep 17 00:00:00 2001
From: Dessie Linden <dessie@lindenlab.com>
Date: Wed, 11 Aug 2010 11:14:59 -0700
Subject: Updated viewer patch number & channel

---
 indra/llcommon/llversionserver.h | 2 +-
 indra/llcommon/llversionviewer.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'indra/llcommon')

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";
 
diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 6e341b83a1..adc23ed9af 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -35,9 +35,9 @@
 
 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_PATCH = 1;
+const S32 LL_VERSION_BUILD = 13828;
 
-const char * const LL_CHANNEL = "Second Life Developer";
+const char * const LL_CHANNEL = "Second Life Release";
 
 #endif
-- 
cgit v1.2.3


From 51d460089e83a7f09b52af80c99392d246448b43 Mon Sep 17 00:00:00 2001
From: Dessie Linden <dessie@lindenlab.com>
Date: Wed, 11 Aug 2010 14:04:27 -0700
Subject: Changed channel info back to Second Life Developer

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/llcommon')

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index adc23ed9af..b10d07b2a1 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -38,6 +38,6 @@ const S32 LL_VERSION_MINOR = 1;
 const S32 LL_VERSION_PATCH = 1;
 const S32 LL_VERSION_BUILD = 13828;
 
-const char * const LL_CHANNEL = "Second Life Release";
+const char * const LL_CHANNEL = "Second Life Developer";
 
 #endif
-- 
cgit v1.2.3