summaryrefslogtreecommitdiffstats
path: root/encoding.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-01 12:24:04 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-01 12:24:04 +0000
commit074d482414640ea2ca4190ae3f902820d32fcd8d (patch)
tree474e4518a368fcd26881d41c3f011e9525b1fdf2 /encoding.c
parent926f1f6c0683da5b7764dbd3184770c758b1465e (diff)
downloadruby-074d482414640ea2ca4190ae3f902820d32fcd8d.tar.gz
ruby-074d482414640ea2ca4190ae3f902820d32fcd8d.tar.xz
ruby-074d482414640ea2ca4190ae3f902820d32fcd8d.zip
* include/ruby/encoding.h (rb_isascii): defined.
(rb_isalnum): ditto. (rb_isalpha): ditto. (rb_isblank): ditto. (rb_iscntrl): ditto. (rb_isdigit): ditto. (rb_isgraph): ditto. (rb_islower): ditto. (rb_isprint): ditto. (rb_ispunct): ditto. (rb_isspace): ditto. (rb_isupper): ditto. (rb_isxdigit): ditto. (rb_tolower): ditto. (rb_toupper): ditto. * include/ruby/st.h (st_strcasecmp): declared. (st_strncasecmp): ditto. * st.c (type_strcasehash): use st_strcasecmp instead of strcasecmp. (st_strcasecmp): defined. (st_strncasecmp): ditto. * include/ruby/ruby.h: include include/ruby/encoding.h. (ISASCII): use rb_isascii. (ISPRINT): use rb_isprint. (ISSPACE): use rb_isspace. (ISUPPER): use rb_isupper. (ISLOWER): use rb_islower. (ISALNUM): use rb_isalnum. (ISALPHA): use rb_isalpha. (ISDIGIT): use rb_isdigit. (ISXDIGIT): use rb_isxdigit. (TOUPPER): defined. (TOLOWER): ditto. (STRCASECMP): ditto. (STRNCASECMP): ditto. * dir.c, encoding.c, file.c, hash.c, process.c, ruby.c, time.c, transcode.c, ext/readline/readline.c: use locale insensitive functions. [ruby-core:14662] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/encoding.c b/encoding.c
index cf044b1cb..0a8e249cd 100644
--- a/encoding.c
+++ b/encoding.c
@@ -173,7 +173,7 @@ rb_enc_register(const char *name, rb_encoding *encoding)
if (index >= 0) {
rb_encoding *oldenc = rb_enc_from_index(index);
- if (strcasecmp(name, rb_enc_name(oldenc))) {
+ if (STRCASECMP(name, rb_enc_name(oldenc))) {
st_data_t key = (st_data_t)name, alias;
st_delete(enc_table_alias, &key, &alias);
index = enc_register(name, encoding);
@@ -341,7 +341,7 @@ rb_enc_registered(const char *name)
if (i < ENCODING_INLINE_MAX - 1) i = ENCODING_INLINE_MAX - 1;
continue;
}
- if (strcasecmp(name, enc_table[i].name) == 0) {
+ if (STRCASECMP(name, enc_table[i].name) == 0) {
return i;
}
}
@@ -368,7 +368,7 @@ rb_enc_find_index(const char *name)
char *s = RSTRING_PTR(enclib) + 4, *e = RSTRING_END(enclib);
while (s < e) {
if (!ISALNUM(*s)) *s = '_';
- else if (ISUPPER(*s)) *s = tolower(*s);
+ else if (ISUPPER(*s)) *s = TOLOWER(*s);
++s;
}
OBJ_FREEZE(enclib);