From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS8473 37.123.128.0/18 X-Spam-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00, RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_ZBI,RCVD_IN_XBL,SPF_FAIL,SPF_HELO_FAIL shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from 80x24.org (h-133-148.a2.corp.bahnhof.no [37.123.133.148]) by dcvr.yhbt.net (Postfix) with ESMTP id BCC0020955 for ; Thu, 16 Mar 2017 23:57:15 +0000 (UTC) From: Eric Wong To: spew@80x24.org Subject: [PATCH 2/3] deduplicate File::NULL string Date: Thu, 16 Mar 2017 23:57:08 +0000 Message-Id: <20170316235709.20071-2-e@80x24.org> In-Reply-To: <20170316235709.20071-1-e@80x24.org> References: <20170316235709.20071-1-e@80x24.org> List-Id: "/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 --- file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- EW