Skip to content

Commit

Permalink
Import of HMBRAND/Text-CSV_XS-0.79 from CPAN.
Browse files Browse the repository at this point in the history
gitpan-cpan-distribution: Text-CSV_XS
gitpan-cpan-version:      0.79
gitpan-cpan-path:         HMBRAND/Text-CSV_XS-0.79.tgz
gitpan-cpan-author:       HMBRAND
gitpan-cpan-maturity:     released
  • Loading branch information
H.Merijn Brand authored and Gitpan committed Oct 22, 2014
1 parent a33f2b0 commit 9df8807
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 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.78";
$VERSION = "0.79";
@ISA = qw( DynaLoader );
bootstrap Text::CSV_XS $VERSION;

Expand Down
10 changes: 5 additions & 5 deletions CSV_XS.xs
Expand Up @@ -336,8 +336,8 @@ static void cx_xs_cache_diag (pTHX_ HV *hv)
byte *cp, c;

unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp) {
warn ("CACHE: invalid\n"); /* uncovered */
return; /* uncovered */
warn ("CACHE: invalid\n");
return;
}

cp = (byte *)SvPV_nolen (*svp);
Expand Down Expand Up @@ -737,13 +737,13 @@ static int cx_CsvGet (pTHX_ csv_t *csv, SV *src)

if (csv->tmp && csv->eol_pos >= 0) {
csv->eol_pos = -2;
sv_setpvn (csv->tmp, csv->eol, csv->eol_len);
sv_setpvn (csv->tmp, (char *)csv->eol, csv->eol_len);
csv->bptr = SvPV (csv->tmp, csv->size);
csv->used = 0;
return CH_EOLX;
}

{ int result, rslen;
{ STRLEN result, rslen;
const char *rs;

dSP;
Expand All @@ -753,7 +753,7 @@ static int cx_CsvGet (pTHX_ csv_t *csv, SV *src)
csv->eol_pos = -1;
if (csv->eolx || csv->eol_is_cr) {
rs = SvPOK (PL_rs) || SvPOKp (PL_rs) ? SvPV_const (PL_rs, rslen) : NULL;
sv_setpvn (PL_rs, csv->eol, csv->eol_len);
sv_setpvn (PL_rs, (char *)csv->eol, csv->eol_len);
}
PUSHMARK (sp);
EXTEND (sp, 1);
Expand Down
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2010-11-26 0.79 - H.Merijn Brand <h.m.brand@xs4all.nl>
* Use correct type for STRLEN (HP-UX/PA-RISC/32)
* More code coverage
* EOF unreliable when line-end missing at eof

2010-11-26 0.78 - H.Merijn Brand <h.m.brand@xs4all.nl>
* Version 0.77 broke MacOS exported CSV files with only \r

Expand Down
4 changes: 2 additions & 2 deletions META.yml
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Text-CSV_XS
version: 0.78
version: 0.79
abstract: Comma-Separated Values manipulation routines
license: perl
author:
Expand All @@ -10,7 +10,7 @@ distribution_type: module
provides:
Text::CSV_XS:
file: CSV_XS.pm
version: 0.78
version: 0.79
requires:
perl: 5.005
DynaLoader: 0
Expand Down
4 changes: 1 addition & 3 deletions t/45_eol.t
Expand Up @@ -3,7 +3,7 @@
use strict;
$^W = 1;

use Test::More tests => 1067;
use Test::More tests => 1065;

BEGIN {
require_ok "Text::CSV_XS";
Expand Down Expand Up @@ -250,8 +250,6 @@ $/ = $def_rs;
ok ( $row = $csv->getline (*FH), "getline 16");
is (scalar @$row, 15, "field count");
is ($row->[0], "", "field 1");
is ($csv->getline (*FH), undef, "EOF");
ok ($csv->eof, "Status");
}

1;
9 changes: 8 additions & 1 deletion t/80_diag.t
Expand Up @@ -3,7 +3,7 @@
use strict;
$^W = 1;

use Test::More tests => 122;
use Test::More tests => 124;
#use Test::More "no_plan";

my %err;
Expand Down Expand Up @@ -116,6 +116,13 @@ $csv = Text::CSV_XS->new ({ auto_diag => 1 });
like ($@, qr '^# CSV_XS ERROR: 2027 -', "2 - error message");
}

{ my @warn;
local $SIG{__WARN__} = sub { push @warn, @_ };
Text::CSV_XS->new ()->_cache_diag ();
ok (@warn == 1, "Got warn");
is ($warn[0], "CACHE: invalid\n", "Uninitialized cache");
}

my $diag_file = "_$$.out";
open EH, ">&STDERR";
open STDERR, ">$diag_file";
Expand Down

0 comments on commit 9df8807

Please sign in to comment.