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 | 40f95dff44933b4b5f5cd10c1bfed3114928e518 (patch) | |
tree | 6af65afa3f9036e2558442e34ff68e56fc33baee /missing | |
parent | 4b4fcead353b8f3ab49158235fbec5267819cd06 (diff) | |
download | ruby-40f95dff44933b4b5f5cd10c1bfed3114928e518.tar.gz ruby-40f95dff44933b4b5f5cd10c1bfed3114928e518.tar.xz ruby-40f95dff44933b4b5f5cd10c1bfed3114928e518.zip |
* missing/langinfo.c (nl_langinfo_codeset): accepts iso-8859
fragment. [ruby-core:21757]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r-- | missing/langinfo.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/missing/langinfo.c b/missing/langinfo.c index a76000bc7..6373afd0f 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++; |