Skip to content

Commit

Permalink
Import of HMBRAND/Text-CSV_XS-0.64 from CPAN.
Browse files Browse the repository at this point in the history
gitpan-cpan-distribution: Text-CSV_XS
gitpan-cpan-version:      0.64
gitpan-cpan-path:         HMBRAND/Text-CSV_XS-0.64.tgz
gitpan-cpan-author:       HMBRAND
gitpan-cpan-maturity:     released
  • Loading branch information
H.Merijn Brand authored and Gitpan committed Oct 22, 2014
1 parent cbe9e24 commit f1de084
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 27 deletions.
2 changes: 1 addition & 1 deletion CSV_XS.pm
Expand Up @@ -30,7 +30,7 @@ use DynaLoader ();
use Carp;

use vars qw( $VERSION @ISA );
$VERSION = "0.63";
$VERSION = "0.64";
@ISA = qw( DynaLoader );
bootstrap Text::CSV_XS $VERSION;

Expand Down
6 changes: 4 additions & 2 deletions CSV_XS.xs
Expand Up @@ -254,8 +254,9 @@ static void cx_SetupCsv (pTHX_ csv_t *csv, HV *self)
csv->eol = (char *)&csv->cache[CACHE_ID_eol];
else {
/* Was too long to cache. must re-fetch */
csv->eol = NULL;
csv->eol = NULL;
csv->eol_is_cr = 0;
csv->eol_len = 0;
if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
csv->eol = SvPV (*svp, len);
csv->eol_len = len;
Expand Down Expand Up @@ -302,8 +303,9 @@ static void cx_SetupCsv (pTHX_ csv_t *csv, HV *self)
csv->sep_char = *ptr;
}

csv->eol = NULL;
csv->eol = "";
csv->eol_is_cr = 0;
csv->eol_len = 0;
if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
csv->eol = SvPV (*svp, len);
csv->eol_len = len;
Expand Down
8 changes: 8 additions & 0 deletions ChangeLog
@@ -1,3 +1,11 @@
2009-04-03 0.64 - H.Merijn Brand <h.m.brand@xs4all.nl>

* Skip perlio tests for perl older than 5.8, as perlio
was experimental in 5.6
* Up Devel::PPPort to 3.17
* Fix initialisation of eol => undef (could cause core dump)
* Added configure_require to META.yml

2009-03-20 0.63 - H.Merijn Brand <h.m.brand@xs4all.nl>

* Fixed allow_whitespace with sep_char = TAB (RT#44402)
Expand Down
42 changes: 22 additions & 20 deletions META.yml
@@ -1,29 +1,31 @@
--- #YAML:1.1
name: Text-CSV_XS
version: 0.63
abstract: Comma-Separated Values manipulation routines
license: perl
name: Text-CSV_XS
version: 0.64
abstract: Comma-Separated Values manipulation routines
license: perl
author:
- H.Merijn Brand <h.m.brand@xs4all.nl>
generated_by: Author
distribution_type: module
generated_by: Author
distribution_type: module
provides:
Text::CSV_XS:
file: CSV_XS.pm
version: 0.63
file: CSV_XS.pm
version: 0.64
requires:
perl: 5.005
DynaLoader: 0
IO::Handle: 0
perl: 5.005
DynaLoader: 0
IO::Handle: 0
configure_requires:
ExtUtils::MakeMaker: 0
build_requires:
perl: 5.005
Config: 0
Test::Harness: 0
Test::More: 0
Tie::Scalar: 0
perl: 5.005
Config: 0
Test::Harness: 0
Test::More: 0
Tie::Scalar: 0
resources:
license: http://dev.perl.org/licenses/
repository: http://repo.or.cz/w/Text-CSV_XS.git
license: http://dev.perl.org/licenses/
repository: http://repo.or.cz/w/Text-CSV_XS.git
meta-spec:
version: 1.4
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
url: http://module-build.sourceforge.net/META-spec-v1.4.html
9 changes: 7 additions & 2 deletions README
Expand Up @@ -16,9 +16,14 @@ Copying:

Recent changes can be (re)viewed in the public GIT repository at
http://repo.or.cz/w/Text-CSV_XS.git
Feel free to clone your own copy
Feel free to clone your own copy:

$ git clone http://repo.or.cz/r/Text-CSV_XS.git Text-CSV-XS
$ git clone http://repo.or.cz/r/Text-CSV_XS.git Text-CSV-XS

or get it as a tgz:

$ wget --output-document=Text-CSV_XS-git.tgz \
'http://repo.or.cz/w/Text-CSV_XS.git?a=snapshot;sf=tgz'

Prerequisites:
perl 5.005_03. 5.005 will not be able to build the manual pages.
Expand Down
3 changes: 2 additions & 1 deletion t/22_scalario.t
Expand Up @@ -10,8 +10,9 @@ use Test::More;
BEGIN {
unless (exists $Config{useperlio} &&
defined $Config{useperlio} &&
$] >= 5.008 && # perlio was experimental in 5.6.2, but not reliable
$Config{useperlio} eq "define") {
plan skip_all => "No perlIO available";
plan skip_all => "No reliable perlIO available";
}
else {
plan tests => 105;
Expand Down
18 changes: 17 additions & 1 deletion t/45_eol.t
Expand Up @@ -3,7 +3,7 @@
use strict;
$^W = 1;

use Test::More tests => 255;
use Test::More tests => 262;

BEGIN {
require_ok "Text::CSV_XS";
Expand Down Expand Up @@ -127,4 +127,20 @@ ok (1, "Specific \\r test from tfrayner");
unlink "_eol.csv";
}

ok (1, "EOL undef");
{ $/ = "\r";
ok (my $csv = Text::CSV_XS->new ({eol => undef }), "new csv with eol => undef");
open FH, ">_eol.csv";
ok ($csv->print (*FH, [1, 2, 3]), "print");
ok ($csv->print (*FH, [4, 5, 6]), "print");
close FH;

open FH, "<_eol.csv";
ok (my $row = $csv->getline (*FH), "getline 1");
is (scalar @$row, 5, "# fields");
is_deeply ($row, [ 1, 2, 34, 5, 6], "fields 1");
close FH;
unlink "_eol.csv";
}

1;

0 comments on commit f1de084

Please sign in to comment.