r24459 - in /branches/upstream/libtext-csv-perl/current: Changes MANIFEST META.yml README lib/Text/CSV.pm lib/Text/CSV_PP.pm t/71_pp.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Fri Aug 22 13:39:03 UTC 2008


Author: ansgar-guest
Date: Fri Aug 22 13:39:01 2008
New Revision: 24459

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=24459
Log:
[svn-upgrade] Integrating new upstream version, libtext-csv-perl (1.08)

Added:
    branches/upstream/libtext-csv-perl/current/t/71_pp.t
Modified:
    branches/upstream/libtext-csv-perl/current/Changes
    branches/upstream/libtext-csv-perl/current/MANIFEST
    branches/upstream/libtext-csv-perl/current/META.yml
    branches/upstream/libtext-csv-perl/current/README
    branches/upstream/libtext-csv-perl/current/lib/Text/CSV.pm
    branches/upstream/libtext-csv-perl/current/lib/Text/CSV_PP.pm

Modified: branches/upstream/libtext-csv-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-csv-perl/current/Changes?rev=24459&op=diff
==============================================================================
--- branches/upstream/libtext-csv-perl/current/Changes (original)
+++ branches/upstream/libtext-csv-perl/current/Changes Fri Aug 22 13:39:01 2008
@@ -1,4 +1,8 @@
 Revision history for Perl extension Text::CSV.
+
+1.08  Fri Aug 22 11:21:38 2008
+	- fixed a bug in parsing tab separated values with allow_whitespace
+	    pointed by and thanks a patch to Mike O'Sullivan
 
 1.07  Fri Aug  1 11:13:06 2008
 	- updated the compatibility for Text::CSV_XS version 0.52

Modified: branches/upstream/libtext-csv-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-csv-perl/current/MANIFEST?rev=24459&op=diff
==============================================================================
--- branches/upstream/libtext-csv-perl/current/MANIFEST (original)
+++ branches/upstream/libtext-csv-perl/current/MANIFEST Fri Aug 22 13:39:01 2008
@@ -22,6 +22,7 @@
 t/60_samples.t		Miscellaneous problems from the modules history.
 t/65_allow.t		Allow bad formats
 t/70_rt.t		Tests based on RT reports (for Text::CSV_XS)
+t/71_pp.t		Tests for bug report fixes or patches (for Text::CSV_PP)
 t/75_hashref.t          getline_hr related tests
 t/76_magic.t            array_ref from magig (useless for Text::CSV_PP)
 t/80_diag.t		Error diagnostics

Modified: branches/upstream/libtext-csv-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-csv-perl/current/META.yml?rev=24459&op=diff
==============================================================================
--- branches/upstream/libtext-csv-perl/current/META.yml (original)
+++ branches/upstream/libtext-csv-perl/current/META.yml Fri Aug 22 13:39:01 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Text-CSV
-version:             1.07
+version:             1.08
 abstract:            comma-separated values manipulator (using XS or PurePerl)
 license:             ~
 author:              

Modified: branches/upstream/libtext-csv-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-csv-perl/current/README?rev=24459&op=diff
==============================================================================
--- branches/upstream/libtext-csv-perl/current/README (original)
+++ branches/upstream/libtext-csv-perl/current/README Fri Aug 22 13:39:01 2008
@@ -1,4 +1,4 @@
-Text::CSV version 1.07
+Text::CSV version 1.08
 ========================
 
 comma-separated values manipulator

Modified: branches/upstream/libtext-csv-perl/current/lib/Text/CSV.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-csv-perl/current/lib/Text/CSV.pm?rev=24459&op=diff
==============================================================================
--- branches/upstream/libtext-csv-perl/current/lib/Text/CSV.pm (original)
+++ branches/upstream/libtext-csv-perl/current/lib/Text/CSV.pm Fri Aug 22 13:39:01 2008
@@ -5,7 +5,7 @@
 use Carp ();
 
 BEGIN {
-    $Text::CSV::VERSION = '1.07';
+    $Text::CSV::VERSION = '1.08';
     $Text::CSV::DEBUG   = 0;
 }
 
@@ -270,7 +270,7 @@
 
 =head1 VERSION
 
-    1.07
+    1.08
 
 This module is compatible with Text::CSV_XS B<0.52> or later.
 

Modified: branches/upstream/libtext-csv-perl/current/lib/Text/CSV_PP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-csv-perl/current/lib/Text/CSV_PP.pm?rev=24459&op=diff
==============================================================================
--- branches/upstream/libtext-csv-perl/current/lib/Text/CSV_PP.pm (original)
+++ branches/upstream/libtext-csv-perl/current/lib/Text/CSV_PP.pm Fri Aug 22 13:39:01 2008
@@ -11,7 +11,7 @@
 use vars qw($VERSION);
 use Carp ();
 
-$VERSION = '1.15';
+$VERSION = '1.16';
 
 sub PV  { 0 }
 sub IV  { 1 }
@@ -498,11 +498,18 @@
 sub _make_regexp_split_column_allow_sp {
     my ($esc, $quot, $sep) = @_;
 
+    # if separator is space or tab, don't count that separator
+    # as whitespace  --- patched by Mike O'Sullivan
+    my $ws = $sep eq ' '  ? '[\x09]'
+           : $sep eq "\t" ? '[\x20]'
+           : '[\x20\x09]'
+           ;
+
     if ( $quot eq '' ) {
-        return qr/[\x20\x09]*([^\Q$sep\E]?)[\x20\x09]*\Q$sep\E[\x20\x09]*/s;
-    }
-
-    qr/[\x20\x09]*
+        return qr/$ws*([^\Q$sep\E]?)$ws*\Q$sep\E$ws*/s;
+    }
+
+    qr/$ws*
        (
         \Q$quot\E
             [^\Q$quot$esc\E]*(?:\Q$esc\E[\Q$quot$esc\E0][^\Q$quot$esc\E]*)*
@@ -510,7 +517,7 @@
         | # or
         [^\Q$sep\E]*?
        )
-       [\x20\x09]*\Q$sep\E[\x20\x09]*
+       $ws*\Q$sep\E$ws*
     /xs;
 }
 ################################################################################

Added: branches/upstream/libtext-csv-perl/current/t/71_pp.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-csv-perl/current/t/71_pp.t?rev=24459&op=file
==============================================================================
--- branches/upstream/libtext-csv-perl/current/t/71_pp.t (added)
+++ branches/upstream/libtext-csv-perl/current/t/71_pp.t Fri Aug 22 13:39:01 2008
@@ -1,0 +1,27 @@
+#!/usr/bin/perl
+
+# tests for bug report fixes or patches.
+
+use strict;
+$^W = 1;
+
+use Test::More tests => 3;
+#use Test::More "no_plan";
+
+
+BEGIN { $ENV{PERL_TEXT_CSV} = $ARGV[0] || 0; }
+
+BEGIN {
+    require_ok "Text::CSV";
+    plan skip_all => "Cannot load Text::CSV" if $@;
+}
+
+#print Text::CSV->backend, "\t", Text::CSV->backend->VERSION, "\n";
+
+my $csv = Text::CSV->new( { sep_char => "\t", blank_is_undef => 1, allow_whitespace => 1 } );
+
+ok $csv->parse(qq|John\t\t"my notes"|);
+
+is( 'John,undef,my notes', join( ',', map { ! defined $_ ? 'undef' : $_ } $csv->fields ) );
+
+




More information about the Pkg-perl-cvs-commits mailing list