summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-03-15 05:01:17 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-03-15 05:01:17 +0000
commit0d3f4a92cf4b6558f19a39d416c08db5e0b64a5f (patch)
treef389d5adef64ead31fe63f41eb979ed5d37d9e78
parent31c55301e4c3c84803186d28d2764363b457532f (diff)
2000-03-15
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--configure19
-rw-r--r--configure.in19
-rw-r--r--instruby.rb2
-rw-r--r--string.c32
-rw-r--r--version.h4
6 files changed, 58 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 472719f327..1df0b5e4b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Mar 15 13:12:39 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * string.c (rb_str_chomp_bang): forgot to call rb_str_modify().
+
Mon Mar 13 16:12:13 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* eval.c (block_pass): distinguish real orphan block and still
diff --git a/configure b/configure
index ce9c3dcae1..2e4c5af106 100644
--- a/configure
+++ b/configure
@@ -4933,6 +4933,25 @@ case "$target_os" in
rhasody*)
CFLAGS="$CFLAGS -pipe -no-precomp"
;;
+ osf*)
+ if $without_gcc = "yes" ; then
+ CFLAGS="$CFLAGS -ansi"
+ else
+ # compile something small: taint.c is fine for this.
+ # the main point is the '-v' flag of 'cc'.
+ case "`cc -v -I. -c main.c -o /tmp/main.o 2>&1`" in
+ */gemc_cc*) # we have the new DEC GEM CC
+ CFLAGS="$CFLAGS -frpm d -ieee"
+ ;;
+ *) # we have the old MIPS CC
+ CFLAGS="$CFLAGS -oldc"
+ ;;
+ esac
+ # cleanup
+ rm -f /tmp/main.o
+ CFLAGS="$CFLAGS -std"
+ fi
+ ;;
*)
;;
esac
diff --git a/configure.in b/configure.in
index c4efeef8b2..611a80f5bf 100644
--- a/configure.in
+++ b/configure.in
@@ -774,6 +774,25 @@ case "$target_os" in
rhasody*)
CFLAGS="$CFLAGS -pipe -no-precomp"
;;
+ osf*)
+ if [ $without_gcc = "yes" ]; then
+ CFLAGS="$CFLAGS -ansi"
+ else
+ # compile something small: taint.c is fine for this.
+ # the main point is the '-v' flag of 'cc'.
+ case "`cc -v -I. -c main.c -o /tmp/main.o 2>&1`" in
+ */gemc_cc*) # we have the new DEC GEM CC
+ CFLAGS="$CFLAGS -frpm d -ieee"
+ ;;
+ *) # we have the old MIPS CC
+ CFLAGS="$CFLAGS -oldc"
+ ;;
+ esac
+ # cleanup
+ rm -f /tmp/main.o
+ CFLAGS="$CFLAGS -std"
+ fi
+ ;;
*)
;;
esac
diff --git a/instruby.rb b/instruby.rb
index 3222f72194..3e2c85be85 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -24,7 +24,7 @@ bindir = destdir+CONFIG["bindir"]
libdir = destdir+CONFIG["libdir"]
rubylibdir = destdir+CONFIG["prefix"]+"/lib/ruby"+version
archlibdir = rubylibdir+arch
-sitelibdir = destdir+CONFIG["prefix"]+"/lib/site_ruby"+version
+sitelibdir = destdir+CONFIG["prefix"]+"/lib/ruby/site_ruby"+version
sitearchlibdir = sitelibdir+arch
mandir = destdir+CONFIG["mandir"] + "/man1"
wdir = Dir.getwd
diff --git a/string.c b/string.c
index f68ffb7dc0..3b41298d2d 100644
--- a/string.c
+++ b/string.c
@@ -131,7 +131,7 @@ rb_str_become(str, str2)
RSTRING(str)->orig = 0;
return;
}
- if ((!RSTRING(str)->orig||FL_TEST(str, STR_NO_ORIG))&&RSTRING(str)->ptr)
+ if ((!RSTRING(str)->orig||FL_TEST(str,STR_NO_ORIG))&&RSTRING(str)->ptr)
free(RSTRING(str)->ptr);
RSTRING(str)->ptr = RSTRING(str2)->ptr;
RSTRING(str)->len = RSTRING(str2)->len;
@@ -159,26 +159,17 @@ rb_obj_as_string(obj)
return str;
}
-static VALUE
-str_dup(str)
- VALUE str;
-{
- VALUE s;
-
- if (TYPE(str) != T_STRING) str = rb_str_to_str(str);
- s = rb_str_new(RSTRING(str)->ptr, RSTRING(str)->len);
- if (OBJ_TAINTED(str)) OBJ_TAINT(s);
-
- return s;
-}
-
VALUE
rb_str_dup(str)
VALUE str;
{
if (TYPE(str) != T_STRING) str = rb_str_to_str(str);
if (OBJ_FROZEN(str)) return rb_str_new3(str);
- if (FL_TEST(str, STR_NO_ORIG)) return str_dup(str);
+ if (FL_TEST(str, STR_NO_ORIG)) {
+ VALUE s = rb_str_new(RSTRING(str)->ptr, RSTRING(str)->len);
+ OBJ_INFECT(s, str);
+ return s;
+ }
if (RSTRING(str)->orig) return rb_str_new3(RSTRING(str)->orig);
else {
VALUE shadow;
@@ -343,12 +334,12 @@ rb_str_modify(str)
if (!OBJ_TAINTED(str) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify string");
if (!RSTRING(str)->orig || FL_TEST(str, STR_NO_ORIG)) return;
- ptr = RSTRING(str)->ptr;
- RSTRING(str)->ptr = ALLOC_N(char, RSTRING(str)->len+1);
+ ptr = ALLOC_N(char, RSTRING(str)->len+1);
if (RSTRING(str)->ptr) {
- memcpy(RSTRING(str)->ptr, ptr, RSTRING(str)->len);
- RSTRING(str)->ptr[RSTRING(str)->len] = 0;
+ memcpy(ptr, RSTRING(str)->ptr, RSTRING(str)->len);
}
+ ptr[RSTRING(str)->len] = 0;
+ RSTRING(str)->ptr = ptr;
RSTRING(str)->orig = 0;
}
@@ -1221,6 +1212,7 @@ str_gsub(argc, argv, str, bang)
else {
NEWOBJ(dup, struct RString);
OBJSETUP(dup, rb_cString, T_STRING);
+ OBJ_INFECT(dup, str);
str = (VALUE)dup;
}
RSTRING(str)->ptr = buf;
@@ -2362,6 +2354,7 @@ rb_str_chomp_bang(argc, argv, str)
len--;
}
if (len < RSTRING(str)->len) {
+ rb_str_modify(str);
RSTRING(str)->len = len;
RSTRING(str)->ptr[len] = '\0';
return str;
@@ -2374,6 +2367,7 @@ rb_str_chomp_bang(argc, argv, str)
if (p[len-1] == newline &&
(rslen <= 1 ||
memcmp(RSTRING(rs)->ptr, p+len-rslen, rslen) == 0)) {
+ rb_str_modify(str);
RSTRING(str)->len -= rslen;
RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
return str;
diff --git a/version.h b/version.h
index 96523bd375..f74bd2082a 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.5.3"
-#define RUBY_RELEASE_DATE "2000-03-13"
+#define RUBY_RELEASE_DATE "2000-03-15"
#define RUBY_VERSION_CODE 153
-#define RUBY_RELEASE_CODE 20000313
+#define RUBY_RELEASE_CODE 20000315