summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-31 11:44:49 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-31 11:44:49 +0000
commitf072d4e34a70d79a78d06616aad3658dd6b97141 (patch)
treee057c597ca1693829f73ebba7161435fc7176685 /string.c
parent0d0c31ff8414edc38417b7b172819275e03f4dc3 (diff)
Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/string.c b/string.c
index 3d8a664962..2e0a127f72 100644
--- a/string.c
+++ b/string.c
@@ -545,7 +545,8 @@ rb_str_associated(str)
return Qfalse;
}
-static char *null_str = "";
+static const char null_str[] = "";
+#define null_str ((char *)null_str)
VALUE
rb_string_value(ptr)
@@ -4480,7 +4481,7 @@ rb_str_crypt(str, salt)
{
extern char *crypt();
VALUE result;
- char *s;
+ const char *s;
StringValue(salt);
if (RSTRING(salt)->len < 2)
@@ -4607,7 +4608,8 @@ rb_str_justify(argc, argv, str, jflag)
VALUE w;
long width, flen = 0;
VALUE res;
- char *p, *pend, *f = " ";
+ char *p, *pend;
+ const char *f = " ";
long n;
VALUE pad;
@@ -4633,7 +4635,7 @@ rb_str_justify(argc, argv, str, jflag)
}
}
else {
- char *q = f;
+ const char *q = f;
while (p + flen <= pend) {
memcpy(p,f,flen);
p += flen;