1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Rename FMODE_STRIP_BOM to FMODE_SETENC_BY_BOM.

* include/ruby/io.h, io.c (FMODE_SETENC_BY_BOM):
  renamed from FMODE_STRIP_BOM.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2009-08-21 06:17:06 +00:00
parent f7207fa2fc
commit 7fa7345609
3 changed files with 10 additions and 5 deletions

View file

@ -1,3 +1,8 @@
Fri Aug 21 15:13:08 2009 NARUSE, Yui <naruse@ruby-lang.org>
* include/ruby/io.h, io.c (FMODE_SETENC_BY_BOM):
renamed from FMODE_STRIP_BOM.
Thu Aug 20 01:24:55 2009 NARUSE, Yui <naruse@ruby-lang.org>
* io.c (rb_io_fmode_modestr): change modestr syntax for BOM

View file

@ -94,7 +94,7 @@ typedef struct rb_io_t {
#define FMODE_TEXTMODE 0x00001000
#define FMODE_EOF 0x00002000
/* #define FMODE_PREP 0x00010000 */
#define FMODE_STRIP_BOM 0x00100000
#define FMODE_SETENC_BY_BOM 0x00100000
#define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr)

8
io.c
View file

@ -3989,7 +3989,7 @@ rb_io_modestr_fmode(const char *modestr)
if ((fmode & FMODE_BINMODE) && (fmode & FMODE_TEXTMODE))
goto error;
if (p && io_encname_bom_p(p, 0))
fmode |= FMODE_STRIP_BOM;
fmode |= FMODE_SETENC_BY_BOM;
return fmode;
}
@ -4334,7 +4334,7 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
has_enc = 1;
parse_mode_enc(p+1, &enc, &enc2);
if (io_encname_bom_p(p+1, 0))
fmode |= FMODE_STRIP_BOM;
fmode |= FMODE_SETENC_BY_BOM;
}
else {
rb_encoding *e;
@ -4634,7 +4634,7 @@ rb_file_open_generic(VALUE io, VALUE filename, int oflags, int fmode, convconfig
fptr->pathv = rb_str_new_frozen(filename);
fptr->fd = rb_sysopen(fptr->pathv, oflags, perm);
io_check_tty(fptr);
if (fmode & FMODE_STRIP_BOM) io_set_encoding_by_bom(io);
if (fmode & FMODE_SETENC_BY_BOM) io_set_encoding_by_bom(io);
return io;
}
@ -6400,7 +6400,7 @@ rb_io_initialize(int argc, VALUE *argv, VALUE io)
else if (fileno(stderr) == fd)
fp->stdio_file = stderr;
if (fmode & FMODE_STRIP_BOM) io_set_encoding_by_bom(io);
if (fmode & FMODE_SETENC_BY_BOM) io_set_encoding_by_bom(io);
return io;
}