Index: string.c
===================================================================
RCS file: /cvs/public/parrot/string.c,v
retrieving revision 1.92
diff -u -r1.92 string.c
--- string.c	6 Sep 2002 08:23:07 -0000	1.92
+++ string.c	8 Sep 2002 09:45:57 -0000
@@ -256,10 +256,10 @@
          * in a singlebyte encoding. 
          * This assumes that any singlebyte encoding uses is us-ascii, which is wrong,
          * but consistent withthe result of calling s->encoding->decode */
-        return *((unsigned char*) s->bufstart + idx);
+        return *((unsigned char*) s->strstart + idx);
     }
     else {
-        return s->encoding->decode(s->encoding->skip_forward(s->bufstart, idx));
+        return s->encoding->decode(s->encoding->skip_forward(s->strstart, idx));
     }
 }
 
Index: t/op/string.t
===================================================================
RCS file: /cvs/public/parrot/t/op/string.t,v
retrieving revision 1.32
diff -u -r1.32 string.t
--- t/op/string.t	5 Sep 2002 15:04:27 -0000	1.32
+++ t/op/string.t	8 Sep 2002 10:29:13 -0000
@@ -1,6 +1,6 @@
 #! perl -w
 
-use Parrot::Test tests => 94;
+use Parrot::Test tests => 95;
 use Test::More;
 
 output_is( <<'CODE', <<OUTPUT, "set_s_s|sc" );
@@ -1000,6 +1000,14 @@
 	set S0,"ab"
 	ord I0,S0,-3
 	print I0
+        end
+CODE
+
+output_is(<<'CODE',ord('e'),'ord of substring');
+        set S0, "abcdefghij"
+        substr S1, S0, 2, 6
+        ord I0, S1, 2
+        print I0
         end
 CODE
 
