case 'a':
fromstr = NEXTFROM;
aptr = SvPV(fromstr, fromlen);
- if (pat[-1] == '*') {
+ if (pat[lengthcode ? -2 : -1] == '*') { /* -2 after '/' */
len = fromlen;
if (datumtype == 'Z')
++len;
#!./perl -w
-print "1..613\n";
+print "1..614\n";
BEGIN {
chdir 't' if -d 't';
ok(scalar unpack("w/a*", "\x02abc") eq "ab");
}
+
+{
+ # 614
+
+ # from Wolfgang Laun: fix in change #13163
+
+ my $s = 'ABC' x 10;
+ my $x = 42;
+ my $buf = pack( 'Z*/A* C', $s, $x );
+ my $y;
+
+ my $h = $buf;
+ $h =~ s/[^[:print:]]/./g;
+ ( $s, $y ) = unpack( "Z*/A* C", $buf );
+ ok($h eq "30.ABCABCABCABCABCABCABCABCABCABC*" &&
+ length $buf == 34 &&
+ $s eq "ABCABCABCABCABCABCABCABCABCABC" &
+ $y == 42);
+}