summaryrefslogtreecommitdiff
path: root/ext/etc/etc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-31 10:30:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-31 10:30:33 +0000
commit25c50cd193d89ad0737219142bab191f12b8abe8 (patch)
treea14ada29405880c7f56c615067b6600815f54334 /ext/etc/etc.c
parent22f249ebd7a142faacdf5edd7e196bd2149feae5 (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@10809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/etc/etc.c')
-rw-r--r--ext/etc/etc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 06ae842..65a2963 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -153,8 +153,8 @@ etc_getpwnam(VALUE obj, VALUE nam)
struct passwd *pwd;
SafeStringValue(nam);
- pwd = getpwnam(RSTRING(nam)->ptr);
- if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %s", RSTRING(nam)->ptr);
+ pwd = getpwnam(RSTRING_PTR(nam));
+ if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %s", RSTRING_PTR(nam));
return setup_passwd(pwd);
#else
return Qnil;
@@ -351,8 +351,8 @@ etc_getgrnam(VALUE obj, VALUE nam)
rb_secure(4);
SafeStringValue(nam);
- grp = getgrnam(RSTRING(nam)->ptr);
- if (grp == 0) rb_raise(rb_eArgError, "can't find group for %s", RSTRING(nam)->ptr);
+ grp = getgrnam(RSTRING_PTR(nam));
+ if (grp == 0) rb_raise(rb_eArgError, "can't find group for %s", RSTRING_PTR(nam));
return setup_group(grp);
#else
return Qnil;