summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-10 13:17:43 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-10 13:17:43 +0000
commit67016f368ca55493c34d8b3a6c38a2cd01a951fa (patch)
treec9a9793277c536718457c0cf1e7e1723fec5c5b2 /io.c
parent257c314fbb34230aea4528fbc1276304f6c7575c (diff)
cosmetic changes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/io.c b/io.c
index d3174eef09..b73dbe80e3 100644
--- a/io.c
+++ b/io.c
@@ -3935,15 +3935,16 @@ rb_io_fmode_modestr(int fmode)
}
static int
-io_encname_bom_p(const char *name, long len) {
+io_encname_bom_p(const char *name, long len)
+{
if (len) {
- if (len > 4 && strncasecmp(name + len - 4, "-bom", 4) == 0)
+ if (len > 4 && STRNCASECMP(name + len - 4, "-bom", 4) == 0)
return 1;
}
else {
const char *p = strchr(name, ':');
if (!p) p = name + strlen(name);
- if (p - name > 4 && strncasecmp(p - 4, "-bom", 4) == 0)
+ if (p - name > 4 && STRNCASECMP(p - 4, "-bom", 4) == 0)
return 1;
}
return 0;
@@ -4527,7 +4528,8 @@ static VALUE rb_io_internal_encoding(VALUE);
static void io_encoding_set(rb_io_t *, VALUE, VALUE, VALUE);
static int
-io_strip_bom(VALUE io) {
+io_strip_bom(VALUE io)
+{
int b1, b2, b3, b4;
switch (b1 = FIX2INT(rb_io_getbyte(io))) {
case 0xEF:
@@ -4590,7 +4592,8 @@ io_strip_bom(VALUE io) {
}
static void
-io_set_encoding_by_bom(VALUE io) {
+io_set_encoding_by_bom(VALUE io)
+{
int idx = io_strip_bom(io);
if (idx) {