[svk-devel] svk v2.0.99_991: inappropriate mutation in SVK::Logger $warn

Ruslan Zakirov ruz at bestpractical.com
Thu Feb 14 07:10:13 EST 2008


Thanks, applied.

On Wed, Feb 13, 2008 at 4:50 AM, Mark Eichin <eichin at metacarta.com> wrote:
> lib/SVK/Logger.pm:
>
>  my $warn = sub {
>     $_[1] .= "\n" unless substr( $_[1], -1, 1 ) eq "\n";
>     print $_[1];
>  };
>
>  inappropriately mutates $_[1].  This causes 80+ failures of the form:
>
>  t/01help.........................ok 1/89
>  #   Failed test 'help add'
>  #   in t/01help.t at line 29.
>  #                   'NAME
>  # Modification of a read-only value attempted at /home/eichin/tmp/ubu.gutsy/svk-2.0.1/blib/lib/SVK/Logger.pm line 126.
>  # '
>  #     doesn't match '(?-xism:SYNOPSIS)'
>
>  Trivial fix:
>
>  my $warn = sub {
>     print $_[1];
>     print "\n" unless substr( $_[1], -1, 1 ) eq "\n";
>  };
>
>  (I assume you're using substr because you don't want to interfere with
>  global regexp context and such, so I preserved that...)
>  _______________________________________________
>  svk-devel mailing list
>  svk-devel at bestpractical.com
>  http://lists.bestpractical.com/cgi-bin/mailman/listinfo/svk-devel
>



-- 
Best regards, Ruslan.


More information about the svk-devel mailing list