зеркало из https://github.com/github/ruby.git
* io.c (null_device): the name of null device. [ruby-dev:41791]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e26c0d6d82
Коммит
3e5e1b6c45
|
@ -1,3 +1,7 @@
|
|||
Fri Aug 27 12:25:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (null_device): the name of null device. [ruby-dev:41791]
|
||||
|
||||
Fri Aug 27 07:57:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* array.c (rb_ary_shuffle_bang): bail out from modification during
|
||||
|
|
14
io.c
14
io.c
|
@ -9639,6 +9639,18 @@ rb_get_argv(void)
|
|||
return ARGF.argv;
|
||||
}
|
||||
|
||||
static const char null_device[] =
|
||||
#if defined DOSISH
|
||||
"NUL"
|
||||
#elif defined AMIGA || defined __amigaos__
|
||||
"NIL"
|
||||
#elif defined __VMS
|
||||
"NL:"
|
||||
#else
|
||||
"/dev/null"
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Document-class: IOError
|
||||
*
|
||||
|
@ -9972,6 +9984,8 @@ Init_IO(void)
|
|||
rb_define_method(rb_cIO, "autoclose?", rb_io_autoclose_p, 0);
|
||||
rb_define_method(rb_cIO, "autoclose=", rb_io_set_autoclose, 1);
|
||||
|
||||
rb_define_const(rb_cIO, "NULL", rb_obj_freeze(rb_usascii_str_new2(null_device)));
|
||||
|
||||
rb_define_variable("$stdin", &rb_stdin);
|
||||
rb_stdin = prep_stdio(stdin, FMODE_READABLE, rb_cIO, "<STDIN>");
|
||||
rb_define_hooked_variable("$stdout", &rb_stdout, 0, stdout_setter);
|
||||
|
|
Загрузка…
Ссылка в новой задаче