OSSP CVS Repository

ossp - Check-in [3381]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3381
Date: 2003-May-23 22:37:32 (local)
2003-May-23 20:37:32 (UTC)
User:rse
Branch:
Comment: fix auto-indentation generation on unfolding
Tickets:
Inspections:
Files:
ossp-pkg/string-divert/ChangeLog      1.1 -> 1.2     2 inserted, 0 deleted
ossp-pkg/string-divert/Divert.pm      1.2 -> 1.3     5 inserted, 1 deleted

ossp-pkg/string-divert/ChangeLog 1.1 -> 1.2

--- 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.


ossp-pkg/string-divert/Divert.pm 1.2 -> 1.3

--- 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;
             }

CVSTrac 2.0.1