[#1147] Copying RVALUE — why the lucky stiff <ruby-core@...>

Hello, everyone. Hope you are all doing well.

18 messages 2003/06/17
[#1155] Re: Copying RVALUE — matz@... (Yukihiro Matsumoto) 2003/06/20

Hi,

[#1157] Re: Copying RVALUE — why the lucky stiff <ruby-core@...> 2003/06/20

Yukihiro Matsumoto (matz@ruby-lang.org) wrote:

[#1173] class.c code cleanup (rb_class_*_instance_methods) — Matthew Dempsky <jivera@...>

Hi, I'm new to this mailing list so I don't know the procedure for

15 messages 2003/06/22
[#1174] Re: [Patch] class.c code cleanup (rb_class_*_instance_methods) — nobu.nokada@... 2003/06/22

Hi,

[#1175] Re: [Patch] class.c code cleanup (rb_class_*_instance_methods) — Matthew Dempsky <jivera@...> 2003/06/22

On Sun, 2003-06-22 at 05:36, nobu.nokada@softhome.net wrote:

[#1176] Re: [Patch] class.c code cleanup (rb_class_*_instance_methods) — nobu.nokada@... 2003/06/22

Hi,

[#1193] Re: [Patch] class.c code cleanup (rb_class_*_instance_methods) — Matthew Dempsky <jivera@...> 2003/06/25

On Sun, 2003-06-22 at 07:41, nobu.nokada@softhome.net wrote:

[#1177] Re: In 1.8.0 nil.to_s is not the same as "" — ts <decoux@...>

14 messages 2003/06/22

Re: In 1.8.0 nil.to_s is not the same as ""

From: nobu.nokada@...
Date: 2003-06-22 13:56:58 UTC
List: ruby-core #1178
Hi,

At Sun, 22 Jun 2003 22:37:11 +0900,
ts wrote:
>  This is really a problem :
> 
> svg% ./ruby -e 'Dir.open(String.new(nil.to_s))'
> -e:1: [BUG] Segmentation fault
> ruby 1.8.0 (2003-06-21) [i686-linux]
> 
> Aborted

Should it occur same exception as Dir.open("")?


Index: dir.c
===================================================================
RCS file: /cvs/ruby/src/ruby/dir.c,v
retrieving revision 1.85
diff -u -2 -p -r1.85 dir.c
--- dir.c	19 May 2003 15:54:37 -0000	1.85
+++ dir.c	22 Jun 2003 13:54:45 -0000
@@ -270,4 +270,8 @@ dir_initialize(dir, dirname)
 
     SafeStringValue(dirname);
+    if (!RSTRING(dirname)->len) {
+	errno = ENOENT;
+	rb_sys_fail("");
+    }
     Data_Get_Struct(dir, struct dir_data, dp);
     if (dp->dir) closedir(dp->dir);


-- 
Nobu Nakada

In This Thread