ruby-changes:45923
From: normal <ko1@a...>
Date: Fri, 17 Mar 2017 09:55:54 +0900 (JST)
Subject: [ruby-changes:45923] normal:r57996 (trunk): deduplicate File::NULL string
normal 2017-03-17 09:55:50 +0900 (Fri, 17 Mar 2017) New Revision: 57996 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57996 Log: deduplicate File::NULL string "/dev/null" is a common sight for pre-1.9.3-compatible code targeting *nix systems, so deduplicate it here, as well. * file.c (Init_File): use fstring for File::NULL Modified files: trunk/file.c Index: file.c =================================================================== --- file.c (revision 57995) +++ file.c (revision 57996) @@ -6134,7 +6134,7 @@ Init_File(void) https://github.com/ruby/ruby/blob/trunk/file.c#L6134 rb_define_const(rb_mFConst, "LOCK_NB", INT2FIX(LOCK_NB)); /* Name of the null device */ - rb_define_const(rb_mFConst, "NULL", rb_obj_freeze(rb_usascii_str_new2(null_device))); + rb_define_const(rb_mFConst, "NULL", rb_fstring_cstr(null_device)); rb_define_method(rb_cFile, "path", rb_file_path, 0); rb_define_method(rb_cFile, "to_path", rb_file_path, 0); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/