Wolfgang Laun <Wolfgang.Laun@alcatel.at>
p4raw-id: //depot/perl@12180
goto uchar_checksum;
sv = NEWSV(35, len);
sv_setpvn(sv, s, len);
- s += len;
if (datumtype == 'A' || datumtype == 'Z') {
aptr = s; /* borrow register */
if (datumtype == 'Z') { /* 'Z' strips stuff after first null */
s = SvPVX(sv);
while (*s)
s++;
+ if (star) /* exact for 'Z*' */
+ len = s - SvPVX(sv) + 1;
}
else { /* 'A' strips both nulls and spaces */
s = SvPVX(sv) + len - 1;
SvCUR_set(sv, s - SvPVX(sv));
s = aptr; /* unborrow register */
}
+ s += len;
XPUSHs(sv_2mortal(sv));
break;
case 'B':
-#!./perl -Tw
+#!./perl -w
-print "1..610\n";
+print "1..611\n";
BEGIN {
chdir 't' if -d 't';
or printf "# scalar unpack ('$template', \"%s\") gave %s expected %s\n",
encode ($in), encode_list ($got), encode_list ($out[0]);
}
+
+{
+ # 611
+ my $t = 'Z*Z*';
+ my ($u, $v) = qw(foo xyzzy);
+ my $p = pack($t, $u, $v);
+ my @u = unpack($t, $p);
+ print @u == 2 && $u[0] eq $u && $u[1] eq $v ? "ok 611\n" : "not ok 611\n";
+}