summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-31 10:47:44 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-31 10:47:44 +0000
commit54af80844fbcf132f85e9275673eaa66b72da996 (patch)
tree4509d254ff81222c7b4db1b34cbcc377c2311e54 /signal.c
parent25c50cd193d89ad0737219142bab191f12b8abe8 (diff)
* ruby.h (struct RString): embed small strings.
(RSTRING_LEN): defined for accessing string members. (RSTRING_PTR): ditto. * string.c: use RSTRING_LEN and RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/signal.c b/signal.c
index 8e76090487..1a46bac910 100644
--- a/signal.c
+++ b/signal.c
@@ -242,7 +242,7 @@ rb_f_kill(int argc, VALUE *argv)
goto str_signal;
case T_STRING:
- s = RSTRING(argv[0])->ptr;
+ s = RSTRING_PTR(argv[0]);
if (s[0] == '-') {
negative++;
s++;
@@ -263,7 +263,7 @@ rb_f_kill(int argc, VALUE *argv)
str = rb_check_string_type(argv[0]);
if (!NIL_P(str)) {
- s = RSTRING(str)->ptr;
+ s = RSTRING_PTR(str);
goto str_signal;
}
rb_raise(rb_eArgError, "bad signal type %s",
@@ -574,28 +574,28 @@ trap(struct trap_arg *arg)
command = rb_check_string_type(arg->cmd);
if (!NIL_P(command)) {
SafeStringValue(command); /* taint check */
- switch (RSTRING(command)->len) {
+ switch (RSTRING_LEN(command)) {
case 0:
func = SIG_IGN;
break;
case 7:
- if (strncmp(RSTRING(command)->ptr, "SIG_IGN", 7) == 0) {
+ if (strncmp(RSTRING_PTR(command), "SIG_IGN", 7) == 0) {
func = SIG_IGN;
}
- else if (strncmp(RSTRING(command)->ptr, "SIG_DFL", 7) == 0) {
+ else if (strncmp(RSTRING_PTR(command), "SIG_DFL", 7) == 0) {
func = SIG_DFL;
}
- else if (strncmp(RSTRING(command)->ptr, "DEFAULT", 7) == 0) {
+ else if (strncmp(RSTRING_PTR(command), "DEFAULT", 7) == 0) {
func = SIG_DFL;
}
break;
case 6:
- if (strncmp(RSTRING(command)->ptr, "IGNORE", 6) == 0) {
+ if (strncmp(RSTRING_PTR(command), "IGNORE", 6) == 0) {
func = SIG_IGN;
}
break;
case 4:
- if (strncmp(RSTRING(command)->ptr, "EXIT", 4) == 0) {
+ if (strncmp(RSTRING_PTR(command), "EXIT", 4) == 0) {
arg->cmd = Qundef;
}
break;
@@ -620,7 +620,7 @@ trap(struct trap_arg *arg)
goto str_signal;
case T_STRING:
- s = RSTRING(arg->sig)->ptr;
+ s = RSTRING_PTR(arg->sig);
str_signal:
if (strncmp("SIG", s, 3) == 0)