[#290] — Florian Frank <flori@...>
Hi all,
5 messages
2002/08/03
[#297] GC longjmp macros — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/05
[#308] Q: OSSL in std. distr? — Michal Rokos <m.rokos@...>
Hi,
4 messages
2002/08/08
[#326] Implications of a #force_free method in Object? — Matthew Bloch <mattbee@...>
Hello;
8 messages
2002/08/19
[#328] Int vs Long — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/21
[#337] Int vs Long (2nd part) — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/22
[#340] Int vs Long #3 — Michal Rokos <m.rokos@...>
Hi,
9 messages
2002/08/22
[#344] Re: [Cleanup] Int vs Long #3
— nobu.nokada@...
2002/08/22
Hi,
[#348] Re: [Cleanup] Int vs Long #3
— Michal Rokos <m.rokos@...>
2002/08/23
Hello,
[#353] File (struct stat handling) — Michal Rokos <m.rokos@...>
Hello,
6 messages
2002/08/23
[#358] node.h for eval.c — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/23
[#372] rb_class_path — Michal Rokos <m.rokos@...>
Hello,
7 messages
2002/08/27
[#382] Port match to new dup, clone framework — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/28
[#393] in dln.c — Michal Rokos <m.rokos@...>
Hi,
14 messages
2002/08/30
[#398] Re: [MemLeak] in dln.c
— nobu.nokada@...
2002/08/31
Hi,
[#403] Re: [MemLeak] in dln.c
— Michal Rokos <m.rokos@...>
2002/09/02
Hello,
Re: [Safer] rb_class_path
From:
Michal Rokos <m.rokos@...>
Date:
2002-08-28 14:26:16 UTC
List:
ruby-core #381
Hello,
On Wed, Aug 28, 2002 at 06:29:41PM +0900, nobu.nokada@softhome.net wrote:
> > > + RSTRING(str)->len = strlen(RSTRING(str)->ptr);
If you agree, I will commit this version. (It's based on my 1st
version of this patch and your fix with 2 * SIZEOF_LONG. I think
that it is also to have +1 in the end of rb_str_new (not +1+1))
Michal
Index: signal.c
===================================================================
RCS file: /src/ruby/signal.c,v
retrieving revision 1.36
diff -u -p -r1.36 signal.c
--- signal.c 2002/08/16 07:23:04 1.36
+++ signal.c 2002/08/28 08:22:05
@@ -36,9 +36,7 @@ static struct signals {
#ifdef SIGHUP
{"HUP", SIGHUP},
#endif
-#ifdef SIGINT
{"INT", SIGINT},
-#endif
#ifdef SIGQUIT
{"QUIT", SIGQUIT},
#endif
Index: variable.c
===================================================================
RCS file: /src/ruby/variable.c,v
retrieving revision 1.65
diff -u -p -r1.65 variable.c
--- variable.c 2002/05/14 06:22:26 1.65
+++ variable.c 2002/08/28 08:22:07
@@ -188,17 +188,22 @@ rb_class_path(klass)
if (path) return path;
else {
- char buf[256];
+ VALUE str;
char *s = "Class";
if (TYPE(klass) == T_MODULE) {
- if (rb_obj_class(klass) == rb_cModule)
+ if (rb_obj_class(klass) == rb_cModule) {
s = "Module";
- else
+ }
+ else {
s = rb_class2name(RBASIC(klass)->klass);
+ }
}
- sprintf(buf, "#<%s:0x%lx>", s, klass);
- return rb_str_new2(buf);
+ str = rb_str_new(0, 2 + strlen(s) + 3 + 2 * SIZEOF_LONG + 1);
+ sprintf(RSTRING(str)->ptr, "#<%s:0x%lx>", s, klass);
+ RSTRING(str)->len = strlen(RSTRING(str)->ptr);
+
+ return str;
}
}
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michal Rokos Czech Technical University, Prague
E-mail:m.rokos@sh.cvut.cz ICQ:36118339 Jabber:majkl@jabber.cz
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-