From stdcxx-commits-return-1482-apmail-incubator-stdcxx-commits-archive=incubator.apache.org@incubator.apache.org Wed Jun 27 19:03:38 2007 Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 18761 invoked from network); 27 Jun 2007 19:03:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jun 2007 19:03:38 -0000 Received: (qmail 47354 invoked by uid 500); 27 Jun 2007 19:03:41 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 47339 invoked by uid 500); 27 Jun 2007 19:03:41 -0000 Mailing-List: contact stdcxx-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-commits@incubator.apache.org Received: (qmail 47326 invoked by uid 99); 27 Jun 2007 19:03:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jun 2007 12:03:41 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jun 2007 12:03:37 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 97D0A1A981A; Wed, 27 Jun 2007 12:03:16 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r551274 - /incubator/stdcxx/trunk/tests/src/locale.cpp Date: Wed, 27 Jun 2007 19:03:16 -0000 To: stdcxx-commits@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070627190316.97D0A1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebor Date: Wed Jun 27 12:03:15 2007 New Revision: 551274 URL: http://svn.apache.org/viewvc?view=rev&rev=551274 Log: 2007-06-27 Martin Sebor * locale.cpp [Solaris] (rw_locales): Avoided all locale names starting with "iso_8859_" and the name "common" on SunOS, not just iso_8859_1. They're all known to cause setlocale() to fail. Modified: incubator/stdcxx/trunk/tests/src/locale.cpp Modified: incubator/stdcxx/trunk/tests/src/locale.cpp URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/src/locale.cpp?view=diff&rev=551274&r1=551273&r2=551274 ============================================================================== --- incubator/stdcxx/trunk/tests/src/locale.cpp (original) +++ incubator/stdcxx/trunk/tests/src/locale.cpp Wed Jun 27 12:03:15 2007 @@ -404,12 +404,19 @@ // if successful, construct a char array with the locales while (fgets (linebuf, sizeof linebuf, file)) { - linebuf [strlen (linebuf) - 1] = '\0'; + const size_t linelen = strlen (linebuf); + + linebuf [linelen ? linelen - 1 : 0] = '\0'; #ifdef _RWSTD_OS_SUNOS - // avoid the bad locale named iso_8859_1 on SunOS - if (!strcmp ("iso_8859_1", linebuf)) + const char iso_8859_pfx[] = "iso_8859_"; + + // avoid locales named common and iso_8859_* on SunOS + // since they are known to cause setlocale() to fail + if ( !strcmp ("common", linebuf) + || sizeof iso_8859_pfx <= linelen + && !memcmp (iso_8859_pfx, linebuf, sizeof iso_8859_pfx - 1)) continue; #endif // _RWSTD_OS_SUNOS