aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-17 00:55:50 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-17 00:55:50 +0000
commit9ca27837de3dee99e359cc37049878afa7f5654f (patch)
treef075d42b21682a1e43680839673bce4ebefa4b6a /file.c
parent7ee2c030b0b55f455abb6f07850e41e45d91984f (diff)
downloadruby-9ca27837de3dee99e359cc37049878afa7f5654f.tar.gz
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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/file.c b/file.c
index 8bca84283d..c576c85c0a 100644
--- a/file.c
+++ b/file.c
@@ -6134,7 +6134,7 @@ Init_File(void)
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);