diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 22:02:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 22:02:16 +0000 |
commit | a1dd4a613a521dd4250c26b1aab7e40f49b0d4e9 (patch) | |
tree | 6af65afa3f9036e2558442e34ff68e56fc33baee | |
parent | 28155915a5ad8fecae349894a3445b0fdc876d58 (diff) |
* missing/langinfo.c (nl_langinfo_codeset): accepts iso-8859
fragment. [ruby-core:21757]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | missing/langinfo.c | 7 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Tue Feb 3 07:02:11 2009 Nobuyoshi Nakada <[email protected]> + + * missing/langinfo.c (nl_langinfo_codeset): accepts iso-8859 + fragment. [ruby-core:21757] + Tue Feb 3 07:01:21 2009 Nobuyoshi Nakada <[email protected]> * mkconfig.rb (patchlevel): config.status may not contain diff --git a/missing/langinfo.c b/missing/langinfo.c index a76000bc77..6373afd0f5 100644 --- a/missing/langinfo.c +++ b/missing/langinfo.c @@ -63,6 +63,7 @@ const char * nl_langinfo_codeset(void) { const char *l, *p; + int n; if (((l = getenv("LC_ALL")) && *l) || ((l = getenv("LC_CTYPE")) && *l) || @@ -75,9 +76,9 @@ nl_langinfo_codeset(void) if (!p++) p = l; if (strstart(p, "UTF")) return "UTF-8"; - if (strstart(p, "8859-")) { - if (digit(p[5])) { - p += 5; + if ((n = 5, strstart(p, "8859-")) || (n = 9, strstart(p, "ISO-8859-"))) { + if (digit(p[n])) { + p += n; memcpy(buf, "ISO-8859-\0\0", 12); buf[9] = *p++; if (digit(*p)) buf[10] = *p++; |