/[suikacvs]/test/cvs
Suika

Diff of /test/cvs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by wakaba, Sun Jun 16 10:45:54 2002 UTC revision 1.28 by wakaba, Tue Jul 2 06:37:56 2002 UTC
# Line 35  push @ISA, qw(Message::Field::Structured Line 35  push @ISA, qw(Message::Field::Structured
35      -field_format_pattern       => '%s: %s',      -field_format_pattern       => '%s: %s',
36      -field_name_case_sensible   => 0,      -field_name_case_sensible   => 0,
37      -field_name_unsafe_rule     => 'NON_ftext',      -field_name_unsafe_rule     => 'NON_ftext',
38      -field_name_validation      => 1,   ## Method level option.      -field_name_validation      => 0,
39      -field_sort => 0,      -field_sort => 0,
40      #-format    => 'mail-rfc2822',      #-format    => 'mail-rfc2822',
41        -header_default_charset     => 'iso-2022-int-1',
42        -header_default_charset_input       => 'iso-2022-int-1',
43      -linebreak_strict   => 0,   ## Not implemented completely      -linebreak_strict   => 0,   ## Not implemented completely
44      -line_length_max    => 60,  ## For folding      -line_length_max    => 60,  ## For folding
45      #ns_default_phuri      #ns_default_phuri
# Line 194  sub parse ($$;%) { Line 196  sub parse ($$;%) {
196    my $class = shift;    my $class = shift;
197    my $header = shift;    my $header = shift;
198    my $self = bless {}, $class;    my $self = bless {}, $class;
199    $self->_init (@_);    ## BUG: don't check linebreak_strict    $self->_init (@_);
200    $header =~ s/\x0D?\x0A$REG{WSP}/\x20/gos if $self->{option}->{use_folding};    if ($self->{option}->{linebreak_strict}) {
201        $header =~ s/\x0D\x0A$REG{WSP}/\x20/gos if $self->{option}->{use_folding};
202      } else {
203        $header =~ s/\x0D?\x0A$REG{WSP}/\x20/gos if $self->{option}->{use_folding};
204      }
205    for my $field (split /\x0D?\x0A/, $header) {    for my $field (split /\x0D?\x0A/, $header) {
206      if ($field =~ /$REG{M_fromline}/) {      if ($field =~ /$REG{M_fromline}/) {
207        my ($s,undef,$value) = $self->_value_to_arrayitem        my ($s,undef,$value) = $self->_value_to_arrayitem
# Line 355  sub _parse_value ($$$;%) { Line 361  sub _parse_value ($$$;%) {
361        -format   => $self->{option}->{format},        -format   => $self->{option}->{format},
362        -field_ns => $option{ns},        -field_ns => $option{ns},
363        -field_name       => $name,        -field_name       => $name,
364        -header_default_charset     => $self->{option}->{header_default_charset},
365        -header_default_charset_input       => $self->{option}->{header_default_charset_input},
366        -parse_all        => $self->{option}->{parse_all},        -parse_all        => $self->{option}->{parse_all},
367      %vopt);      %vopt);
368    } else {    } else {
# Line 363  sub _parse_value ($$$;%) { Line 371  sub _parse_value ($$$;%) {
371        -format   => $self->{option}->{format},        -format   => $self->{option}->{format},
372        -field_ns => $option{ns},        -field_ns => $option{ns},
373        -field_name       => $name,        -field_name       => $name,
374        -header_default_charset     => $self->{option}->{header_default_charset},
375        -header_default_charset_input       => $self->{option}->{header_default_charset_input},
376        -parse_all        => $self->{option}->{parse_all},        -parse_all        => $self->{option}->{parse_all},
377      %vopt);      %vopt);
378    }    }
# Line 562  sub _scan_sort ($\@\%) { Line 572  sub _scan_sort ($\@\%) {
572  }  }
573    
574  sub _n11n_field_name ($$) {  sub _n11n_field_name ($$) {
575      no strict 'refs';
576    my $self = shift;    my $self = shift;
577    my $s = shift;    my $s = shift;
578    $s =~ s/^$REG{WSP}+//; $s =~ s/$REG{WSP}+$//;    $s =~ s/^$REG{WSP}+//; $s =~ s/$REG{WSP}+$//;
# Line 719  sub _fold ($$;%) { Line 730  sub _fold ($$;%) {
730    $max = 20 if $max < 20;    $max = 20 if $max < 20;
731        
732    my $l = $option{-initial_length} || 0;    my $l = $option{-initial_length} || 0;
733    $string =~ s{((?:^|[\x09\x20])[^\x09\x20]+)}{    $l += length $1 if $string =~ /^([^\x09\x20]+)/;
734      $string =~ s{([\x09\x20][^\x09\x20]+)}{
735      my $s = $1;      my $s = $1;
736      if ($l + length $s > $max) {      if (($l + length $s) > $max) {
737        $s = "\x0D\x0A\x20" . $s;        $s = "\x0D\x0A\x20" . $s;
738        $l = length ($s) - 2;        $l = 1 + length $s;
739      } else { $l += length $s }      } else { $l += length $s }
740      $s;      $s;
741    }gex;    }gex;

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.28

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24