]> dxcluster.net Git - spider.git/commitdiff
find problem in split in print_all_fields
authorminima <minima>
Fri, 23 Mar 2001 00:38:50 +0000 (00:38 +0000)
committerminima <minima>
Fri, 23 Mar 2001 00:38:50 +0000 (00:38 +0000)
perl/DXUtil.pm

index 2e8a528475ba9bcc75517512d36d5dc94440b6f4..0b3de9511e964f41c6834f025bcf4e60b1dc2f2d 100644 (file)
@@ -183,12 +183,13 @@ sub print_all_fields
                        my ($priv, $ans) = promptf($ref->field_prompt($field), $ref->{$field});
                        my @tmp;
                        if (length $ans > 79) {
-                               my ($p, $a) = split /: /, $ans;
+                               my ($p, $a) = split /: /, $ans, 2;
                                my $l = (length $p) + 2;
                                my $al = 79 - $l;
+                               my $bit;
                                while (length $a > $al ) {
-                                       $a =~ s/^(.{$al})//;
-                                       push @tmp, "$p: $1";
+                                       ($bit, $a) = unpack "A$al A*", $a;
+                                       push @tmp, "$p: $bit";
                                        $p = ' ' x ($l - 2);
                                }
                                push @tmp, "$p: $a" if length $a;