diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-07 05:59:42 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-07 05:59:42 +0000 |
commit | 9d77639f30172b0e3b88ea22df0724df61240161 (patch) | |
tree | 842fe16738ccff2dee8b962b1ed71ddc0eda62c5 /string.c | |
parent | 5208fec1cfd93841e0b1a89c42cc2e8692e1aa9c (diff) |
* parse.y (dsym): :"symbol string" style should not contain `\0'.
* process.c (proc_detach): new method Proc#detach(pid) which
create background watcher thread to issue waitpid. [new]
* process.c (rb_detach_process): utility function to detach
process from C code.
* ext/pty/pty.c (pty_finalize_syswait): terminate watcher thread,
and detach child process (by creating new idle waitpid watcher
thread).
* ext/pty/pty.c (pty_syswait): may lost signal stopped child.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -614,12 +614,7 @@ rb_str_cat(str, ptr, len) if (FL_TEST(str, STR_ASSOC)) { rb_str_modify(str); REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len+len); - if (ptr) { - memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len); - } - else { - MEMZERO(RSTRING(str)->ptr + RSTRING(str)->len, char, len); - } + memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len); RSTRING(str)->len += len; RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; /* sentinel */ return str; @@ -3076,7 +3071,7 @@ rb_str_intern(str) rb_raise(rb_eArgError, "interning empty string"); } if (strlen(RSTRING(str)->ptr) != RSTRING(str)->len) - rb_raise(rb_eArgError, "string contains `\\0'"); + rb_raise(rb_eArgError, "symbol string may not contain `\\0'"); id = rb_intern(RSTRING(str)->ptr); return ID2SYM(id); } |