cvsuser 02/09/04 06:49:55
Modified: . string.c
t/op string.t
Log:
Fixed concat bug, with tests to make sure we find it if it reappears
Courtesy of Leon Brocard <[EMAIL PROTECTED]>
Revision Changes Path
1.91 +2 -2 parrot/string.c
Index: string.c
===================================================================
RCS file: /cvs/public/parrot/string.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -w -r1.90 -r1.91
--- string.c 23 Aug 2002 07:53:35 -0000 1.90
+++ string.c 4 Sep 2002 13:49:23 -0000 1.91
@@ -1,7 +1,7 @@
/* string.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: string.c,v 1.90 2002/08/23 07:53:35 mongo Exp $
+ * $Id: string.c,v 1.91 2002/09/04 13:49:23 dan Exp $
* Overview:
* This is the api definitions for the string subsystem
* Data Structure and Algorithms:
@@ -121,12 +121,12 @@
b = string_transcode(interpreter, b, a->encoding, a->type,
NULL);
}
+ unmake_COW(interpreter, a);
/* make sure A's big enough for both */
if (a->buflen < a->bufused + b->bufused) {
a = string_grow(interpreter, a, ((a->bufused + b->bufused)
- a->buflen) + EXTRA_SIZE);
}
- unmake_COW(interpreter, a);
/* Tack B on the end of A */
mem_sys_memcopy((void *)((ptrcast_t)a->strstart + a->bufused),
1.31 +17 -1 parrot/t/op/string.t
Index: string.t
===================================================================
RCS file: /cvs/public/parrot/t/op/string.t,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -w -r1.30 -r1.31
--- string.t 21 Aug 2002 08:02:56 -0000 1.30
+++ string.t 4 Sep 2002 13:49:55 -0000 1.31
@@ -1,6 +1,6 @@
#! perl -w
-use Parrot::Test tests => 90;
+use Parrot::Test tests => 91;
use Test::More;
output_is( <<'CODE', <<OUTPUT, "set_s_s|sc" );
@@ -1338,6 +1338,22 @@
CODE
ABC
ABCD
+OUTPUT
+
+output_is( <<'CODE', <<OUTPUT, "Check that bug #16874 was fixed" );
+ set S0, "foo "
+ set S1, "bar "
+ set S2, "quux "
+ set S15, ""
+ concat S15, S0
+ concat S15, S1
+ concat S15, S2
+ print "["
+ print S15
+ print "]\n"
+ end
+CODE
+[foo bar quux ]
OUTPUT
# Set all string registers to values given by &$_[0](reg num)