Index: ossp-pkg/string-divert/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/string-divert/ChangeLog,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/string-divert/ChangeLog,v' 2>/dev/null --- ChangeLog 2003/05/23 11:09:56 1.1 +++ ChangeLog 2003/05/23 20:37:32 1.2 @@ -2,6 +2,8 @@ ChangeLog ========= + 0.92 (23-Apr-2003) + o fix auto-indentation generation on unfolding 0.91 (23-Apr-2003) o direct MakeMaker to not install sample[12].pl o cleanup naming of module, etc. Index: ossp-pkg/string-divert/Divert.pm RCS File: /v/ossp/cvs/ossp-pkg/string-divert/Divert.pm,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/string-divert/Divert.pm,v' 2>/dev/null --- Divert.pm 2003/05/23 11:09:56 1.2 +++ Divert.pm 2003/05/23 20:37:32 1.3 @@ -185,7 +185,11 @@ foreach my $chunk (@{$self->{chunks}}) { if (ref($chunk)) { my $prefix = ''; - if ($string =~ m|([^\n]*)(\r?\n)*$|s) { + # check for existing prefix + # (keep in mind that m|([^\n]+)$|s _DOES NOT_ + # take a possibly existing terminating newline + # into account, so we really need an extra match!) + if ($string =~ m|([^\n]+)$|s and $string !~ m|\n$|s) { $prefix = $1; $prefix =~ s|[^ \t]| |sg; }