Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-Text-CSV_XS for openSUSE:Factory checked in at 2024-06-24 20:50:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Text-CSV_XS (Old) and /work/SRC/openSUSE:Factory/.perl-Text-CSV_XS.new.18349 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Text-CSV_XS" Mon Jun 24 20:50:38 2024 rev:55 rq:1182964 version:1.550.0 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Text-CSV_XS/perl-Text-CSV_XS.changes 2024-05-16 17:13:27.608192391 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Text-CSV_XS.new.18349/perl-Text-CSV_XS.changes 2024-06-24 20:51:25.832223558 +0200 @@ -1,0 +2,10 @@ +Sun Jun 23 16:49:35 UTC 2024 - Tina Müller <tina.muel...@suse.com> + +- updated to 1.550.0 (1.55) + see /usr/share/doc/packages/perl-Text-CSV_XS/ChangeLog + + 1.55 - 2024-06-18, H.Merijn Brand + * More fixes for strict under bind_columns (issue 54) + * Strict won't hide previous error (issue 56) + +------------------------------------------------------------------- Old: ---- Text-CSV_XS-1.54.tgz New: ---- Text-CSV_XS-1.55.tgz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Text-CSV_XS.spec ++++++ --- /var/tmp/diff_new_pack.sA2I2i/_old 2024-06-24 20:51:26.360242859 +0200 +++ /var/tmp/diff_new_pack.sA2I2i/_new 2024-06-24 20:51:26.364243005 +0200 @@ -18,10 +18,10 @@ %define cpan_name Text-CSV_XS Name: perl-Text-CSV_XS -Version: 1.540.0 +Version: 1.550.0 Release: 0 -# 1.54 -> normalize -> 1.540.0 -%define cpan_version 1.54 +# 1.55 -> normalize -> 1.550.0 +%define cpan_version 1.55 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Comma-Separated Values manipulation routines URL: https://metacpan.org/release/%{cpan_name} ++++++ Text-CSV_XS-1.54.tgz -> Text-CSV_XS-1.55.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV_XS-1.54/CSV_XS.pm new/Text-CSV_XS-1.55/CSV_XS.pm --- old/Text-CSV_XS-1.54/CSV_XS.pm 2024-04-18 09:41:00.000000000 +0200 +++ new/Text-CSV_XS-1.55/CSV_XS.pm 2024-06-18 08:10:43.000000000 +0200 @@ -23,7 +23,7 @@ use Carp; use vars qw( $VERSION @ISA @EXPORT_OK %EXPORT_TAGS ); -$VERSION = "1.54"; +$VERSION = "1.55"; @ISA = qw( Exporter ); XSLoader::load ("Text::CSV_XS", $VERSION); @@ -3133,7 +3133,8 @@ to store in the fields fetched by L</getline>. When you do not pass enough references to store the fetched fields in, L</getline> will fail with error C<3006>. If you pass more than there are fields to return, the content of -the remaining references is left untouched. +the remaining references is left untouched. Under C<strict> the two should +match, otherwise L</getline> will fail with error C<2014>. $csv->bind_columns (\$code, \$name, \$price, \$description); while ($csv->getline ($fh)) { @@ -3406,6 +3407,18 @@ When called as a class method or a direct function call, the diagnostics are that of the last L</new> call. +=head3 _cache_diag + +Note: This is an internal function only, and output cannot be relied upon. +Use at own risk. + +If debugging beyond what L</error_diag> is able to show, the internal cache +can be shown with this function. + + # Something failed .. + $csv->error_diag; + $csv->_cache_diag (); + =head2 record_number X<record_number> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV_XS-1.54/CSV_XS.xs new/Text-CSV_XS-1.55/CSV_XS.xs --- old/Text-CSV_XS-1.54/CSV_XS.xs 2024-04-11 15:14:07.000000000 +0200 +++ new/Text-CSV_XS-1.55/CSV_XS.xs 2024-06-07 11:09:48.000000000 +0200 @@ -1230,6 +1230,22 @@ return TRUE; } /* Combine */ +#define ErrorDiag(csv) cx_ErrorDiag (aTHX_ csv) +static void cx_ErrorDiag (pTHX_ csv_t *csv) { + SV **svp; + + if ((svp = hv_fetchs (csv->self, "_ERROR_DIAG", FALSE)) && *svp) { + if (SvIOK (*svp)) (void)fprintf (stderr, "ERR: %d\n", SvIV (*svp)); + if (SvPOK (*svp)) (void)fprintf (stderr, "ERR: %s\n", SvPV_nolen (*svp)); + } + if ((svp = hv_fetchs (csv->self, "_ERROR_POS", FALSE)) && *svp) { + if (SvIOK (*svp)) (void)fprintf (stderr, "POS: %d\n", SvIV (*svp)); + } + if ((svp = hv_fetchs (csv->self, "_ERROR_FLD", FALSE)) && *svp) { + if (SvIOK (*svp)) (void)fprintf (stderr, "FLD: %d\n", SvIV (*svp)); + } + } /* ErrorDiag */ + #define ParseError(csv,xse,pos) cx_ParseError (aTHX_ csv, xse, pos) static void cx_ParseError (pTHX_ csv_t *csv, int xse, STRLEN pos) { (void)hv_store (csv->self, "_ERROR_POS", 10, newSViv (pos), 0); @@ -2186,7 +2202,7 @@ (void)hv_store (hv, "_EOF", 4, &PL_sv_no, 0); if (csv.strict) { - STRLEN nf = av_len (av); + STRLEN nf = csv.is_bound ? csv.fld_idx : av_len (av); #if MAINT_DEBUG > 6 (void)fprintf (stderr, "# %04d Strict nf = %2d, n = %2d, idx = %2d, recno = %2d, res = %d\n", __LINE__, nf, csv.strict_n, csv.fld_idx, csv.recno, result); @@ -2194,8 +2210,12 @@ if (nf && !csv.strict_n) csv.strict_n = (short)nf; if (csv.strict_n > 0 && nf != csv.strict_n) { - unless (csv.useIO & useIO_EOF) - ParseError (&csv, 2014, csv.used); + unless (csv.useIO & useIO_EOF) { +#if MAINT_DEBUG > 6 + ErrorDiag (&csv); +#endif + unless (last_error) ParseError (&csv, 2014, csv.used); + } if (last_error) /* an error callback can reset and accept */ result = FALSE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV_XS-1.54/ChangeLog new/Text-CSV_XS-1.55/ChangeLog --- old/Text-CSV_XS-1.54/ChangeLog 2024-04-18 09:42:29.000000000 +0200 +++ new/Text-CSV_XS-1.55/ChangeLog 2024-06-18 08:06:19.000000000 +0200 @@ -1,3 +1,7 @@ +1.55 - 2024-06-18, H.Merijn Brand + * More fixes for strict under bind_columns (issue 54) + * Strict won't hide previous error (issue 56) + 1.54 - 2024-04-18, H.Merijn Brand * Fix doc (Jean Forget, RT#150757) * It's 2024 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV_XS-1.54/MANIFEST new/Text-CSV_XS-1.55/MANIFEST --- old/Text-CSV_XS-1.54/MANIFEST 2024-04-18 14:09:10.000000000 +0200 +++ new/Text-CSV_XS-1.55/MANIFEST 2024-06-18 08:11:44.000000000 +0200 @@ -29,6 +29,7 @@ t/67_emptrow.t Empty row behavior t/68_header.t Test header option combinations t/70_rt.t Tests based on RT reports +t/71_strict.t Test strict rrelated issues t/75_hashref.t getline_hr related tests t/76_magic.t array_ref from magic t/77_getall.t Get all rows at once diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV_XS-1.54/META.json new/Text-CSV_XS-1.55/META.json --- old/Text-CSV_XS-1.54/META.json 2024-04-18 14:09:14.000000000 +0200 +++ new/Text-CSV_XS-1.55/META.json 2024-06-18 08:11:44.000000000 +0200 @@ -1,27 +1,23 @@ { "name" : "Text-CSV_XS", - "author" : [ - "H.Merijn Brand <hmbr...@cpan.org>" - ], "abstract" : "Comma-Separated Values manipulation routines", + "generated_by" : "Author", "dynamic_config" : 1, - "resources" : { - "x_IRC" : "irc://irc.perl.org/#csv", - "repository" : { - "web" : "https://github.com/Tux/Text-CSV_XS", - "type" : "git", - "url" : "https://github.com/Tux/Text-CSV_XS" - }, - "bugtracker" : { - "web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Text-CSV_XS" - }, - "homepage" : "https://metacpan.org/pod/Text::CSV_XS", - "license" : [ - "http://dev.perl.org/licenses/" - ] - }, - "version" : "1.54", + "license" : [ + "perl_5" + ], + "release_status" : "stable", "prereqs" : { + "runtime" : { + "recommends" : { + "Encode" : "3.21" + }, + "requires" : { + "XSLoader" : "0", + "perl" : "5.006001", + "IO::Handle" : "0" + } + }, "test" : { "requires" : { "Tie::Scalar" : "0", @@ -36,35 +32,39 @@ "ExtUtils::MakeMaker" : "0" } }, - "runtime" : { - "requires" : { - "perl" : "5.006001", - "XSLoader" : "0", - "IO::Handle" : "0" - }, - "recommends" : { - "Encode" : "3.21" - } - }, "build" : { "requires" : { "Config" : "0" } } }, - "meta-spec" : { - "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : 2 + "resources" : { + "license" : [ + "http://dev.perl.org/licenses/" + ], + "homepage" : "https://metacpan.org/pod/Text::CSV_XS", + "bugtracker" : { + "web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Text-CSV_XS" + }, + "x_IRC" : "irc://irc.perl.org/#csv", + "repository" : { + "url" : "https://github.com/Tux/Text-CSV_XS", + "web" : "https://github.com/Tux/Text-CSV_XS", + "type" : "git" + } }, - "generated_by" : "Author", "provides" : { "Text::CSV_XS" : { - "version" : "1.54", - "file" : "CSV_XS.pm" + "file" : "CSV_XS.pm", + "version" : "1.55" } }, - "release_status" : "stable", - "license" : [ - "perl_5" + "meta-spec" : { + "version" : 2, + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec" + }, + "version" : "1.55", + "author" : [ + "H.Merijn Brand <hmbr...@cpan.org>" ] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV_XS-1.54/META.yml new/Text-CSV_XS-1.55/META.yml --- old/Text-CSV_XS-1.54/META.yml 2024-04-18 14:09:14.000000000 +0200 +++ new/Text-CSV_XS-1.55/META.yml 2024-06-18 08:11:44.000000000 +0200 @@ -16,7 +16,7 @@ provides: Text::CSV_XS: file: CSV_XS.pm - version: '1.54' + version: '1.55' recommends: Encode: '3.21' requires: @@ -31,4 +31,4 @@ homepage: https://metacpan.org/pod/Text::CSV_XS license: http://dev.perl.org/licenses/ repository: https://github.com/Tux/Text-CSV_XS -version: '1.54' +version: '1.55' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV_XS-1.54/ppport.h new/Text-CSV_XS-1.55/ppport.h --- old/Text-CSV_XS-1.54/ppport.h 2024-01-04 10:29:29.000000000 +0100 +++ new/Text-CSV_XS-1.55/ppport.h 2024-06-18 08:07:48.000000000 +0200 @@ -4,9 +4,9 @@ /* ---------------------------------------------------------------------- - ppport.h -- Perl/Pollution/Portability Version 3.71 + ppport.h -- Perl/Pollution/Portability Version 3.72 - Automatically created by Devel::PPPort running under perl 5.038002. + Automatically created by Devel::PPPort running under perl 5.040000. Do NOT edit this file directly! -- Edit PPPort_pm.PL and the includes in parts/inc/ instead. @@ -21,7 +21,7 @@ =head1 NAME -ppport.h - Perl/Pollution/Portability version 3.71 +ppport.h - Perl/Pollution/Portability version 3.72 =head1 SYNOPSIS @@ -588,7 +588,7 @@ # Disable broken TRIE-optimization BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if "$]" >= "5.009004" && "$]" <= "5.009005"} -my $VERSION = 3.71; +my $VERSION = 3.72; my %opt = ( quiet => 0, @@ -7087,6 +7087,7 @@ PerlSock_socketpair|5.005000||Viu PerlSock_socketpair_cloexec|5.027008||Viu Perl_sqrt|5.006000|5.006000|n +PERL_STACK_OFFSET_DEFINED|||piu PERL_STACK_OVERFLOW_CHECK|5.006000||Viu PERL_STATIC_FORCE_INLINE|5.031011||Viu PERL_STATIC_FORCE_INLINE_NO_RET|5.031011||Viu @@ -8895,6 +8896,8 @@ SSPUSHUV|5.013001||Viu ST|5.003007|5.003007| stack_grow|5.003007||cVu +Stack_off_t_MAX|||piu +Stack_off_t|||piu STANDARD_C|5.003007||Viu STAR|5.003007||Viu STAR_t8|5.035004||Viu @@ -9020,7 +9023,7 @@ sv_2num|5.010000||xVi sv_2nv|5.013001||Viu sv_2nv_flags|5.013001|5.013001| -sv_2pv|5.005000||cVu +sv_2pv|5.005000||pcVu sv_2pvbyte|5.006000|5.003007|p sv_2pvbyte_flags|5.031004|5.031004|u sv_2pvbyte_nolen|5.009003||pcV @@ -11567,7 +11570,7 @@ #define DPPP_CAT2(x,y) CAT2(x,y) #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name) -#define D_PPP_RELEASE_DATE 1647561600 /* 2022-03-18 */ +#define D_PPP_RELEASE_DATE 1693785600 /* 2023-09-04 */ #if ! defined(PERL_REVISION) && ! defined(PERL_VERSION_MAJOR) # if ! defined(__PATCHLEVEL_H_INCLUDED__) \ @@ -11679,8 +11682,8 @@ * is in ASCII and EBCDIC respectively */ #ifndef PERL_VERSION_EQ # define PERL_VERSION_EQ(j,n,p) \ - (((p) == '*') ? ( (j) == D_PPP_VERSION_MAJOR \ - && (n) == D_PPP_VERSION_MINOR) \ + (((p) == '*') ? ( (j) == D_PPP_MAJOR \ + && (n) == D_PPP_MINOR) \ : (PERL_BCDVERSION == D_PPP_JNP_TO_BCD(j,n,p))) #endif @@ -11689,7 +11692,7 @@ #endif #ifndef PERL_VERSION_LT # define PERL_VERSION_LT(j,n,p) /* p=='*' means _LT(j,n,0) */ \ - (PERL_BCDVERSION < D_PPP_JNP_TO_BCD( (j), \ + (PERL_BCDVERSION < D_PPP_JNP_TO_BCD( (j), \ (n), \ (((p) == '*') ? 0 : (p)))) #endif @@ -11698,10 +11701,10 @@ # define PERL_VERSION_GE(j,n,p) (! PERL_VERSION_LT(j,n,p)) #endif #ifndef PERL_VERSION_LE -# define PERL_VERSION_LE(j,n,p) /* p=='*' means _LT(j,n+1,0) */ \ - (PERL_BCDVERSION < D_PPP_JNP_TO_BCD( (j), \ - (((p) == '*') ? ((n)+1) : (n)), \ - (((p) == '*') ? 0 : (p)))) +# define PERL_VERSION_LE(j,n,p) /* p=='*' means _LE(j,n,999) */ \ + (PERL_BCDVERSION <= D_PPP_JNP_TO_BCD( (j), \ + (n), \ + (((p) == '*') ? 999 : (p)))) #endif #ifndef PERL_VERSION_GT @@ -12770,6 +12773,12 @@ # define PTR2ul(p) INT2PTR(unsigned long,p) # endif #endif + +#ifndef PERL_STACK_OFFSET_DEFINED + typedef I32 Stack_off_t; +# define Stack_off_t_MAX I32_MAX +# define PERL_STACK_OFFSET_DEFINED +#endif #ifndef PTR2nat # define PTR2nat(p) (PTRV)(p) #endif @@ -12790,17 +12799,38 @@ # define PTR2NV(p) NUM2PTR(NV,p) #endif +#ifdef __cplusplus #undef START_EXTERN_C +#ifndef START_EXTERN_C +# define START_EXTERN_C extern "C" { +#endif + #undef END_EXTERN_C +#ifndef END_EXTERN_C +# define END_EXTERN_C } +#endif + #undef EXTERN_C -#ifdef __cplusplus -# define START_EXTERN_C extern "C" { -# define END_EXTERN_C } -# define EXTERN_C extern "C" +#ifndef EXTERN_C +# define EXTERN_C extern "C" +#endif + #else +#undef START_EXTERN_C +#ifndef START_EXTERN_C # define START_EXTERN_C +#endif + +#undef END_EXTERN_C +#ifndef END_EXTERN_C # define END_EXTERN_C -# define EXTERN_C extern +#endif + +#undef EXTERN_C +#ifndef EXTERN_C +# define EXTERN_C extern +#endif + #endif #if (PERL_BCDVERSION < 0x5004000) || defined(PERL_GCC_PEDANTIC) @@ -12820,14 +12850,28 @@ # endif #endif +#if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__) #undef STMT_START +#ifndef STMT_START +# define STMT_START if (1) +#endif + #undef STMT_END -#if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__) -# define STMT_START if (1) -# define STMT_END else (void)0 +#ifndef STMT_END +# define STMT_END else (void)0 +#endif + #else -# define STMT_START do -# define STMT_END while (0) +#undef STMT_START +#ifndef STMT_START +# define STMT_START do +#endif + +#undef STMT_END +#ifndef STMT_END +# define STMT_END while (0) +#endif + #endif #ifndef boolSV # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no) @@ -12919,13 +12963,16 @@ #endif #if (PERL_BCDVERSION < 0x5005000) -# undef XSRETURN -# define XSRETURN(off) \ +#undef XSRETURN +#ifndef XSRETURN +# define XSRETURN(off) \ STMT_START { \ PL_stack_sp = PL_stack_base + ax + ((off) - 1); \ return; \ } STMT_END #endif + +#endif #ifndef XSPROTO # define XSPROTO(name) void name(pTHX_ CV* cv) #endif @@ -13732,7 +13779,8 @@ # define isPRINT_utf8_safe(s,e) D_PPP_IS_GENERIC_UTF8_SAFE(s, e, PRINT) #endif -# undef isPSXSPC_utf8_safe /* Use the modern definition */ +/* Use the modern definition */ +#undef isPSXSPC_utf8_safe #ifndef isPSXSPC_utf8_safe # define isPSXSPC_utf8_safe(s,e) isSPACE_utf8_safe(s,e) #endif @@ -13856,7 +13904,8 @@ # define isPRINT_LC_utf8_safe(s,e) D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, PRINT) #endif -# undef isPSXSPC_LC_utf8_safe /* Use the modern definition */ +/* Use the modern definition */ +#undef isPSXSPC_LC_utf8_safe #ifndef isPSXSPC_LC_utf8_safe # define isPSXSPC_LC_utf8_safe(s,e) isSPACE_LC_utf8_safe(s,e) #endif @@ -14399,13 +14448,39 @@ # define SV_COW_SHARED_HASH_KEYS 0 #endif +#if (PERL_BCDVERSION < 0x5007002) +# +/* Fix sv_2pv for Perl < 5.7.2 - view https://github.com/Dual-Life/Devel-PPPort/issues/231 */ + +# ifdef sv_2pv +# undef sv_2pv +# endif + +# if defined(PERL_USE_GCC_BRACE_GROUPS) +#ifndef sv_2pv +# define sv_2pv(sv, lp) ({ SV *_sv_2pv = (sv); STRLEN sv_2pv_dummy_; STRLEN *_lp_2pv = (lp); _lp_2pv = _lp_2pv ? : &sv_2pv_dummy_; SvPOKp(_sv_2pv) ? ((*(_lp_2pv) = SvCUR(_sv_2pv)), SvPVX(_sv_2pv)) : Perl_sv_2pv(aTHX_ _sv_2pv, (_lp_2pv)); }) +#endif + +# else +#ifndef sv_2pv +# define sv_2pv(sv, lp) (SvPOKp(sv) ? ((*((lp) ? (lp) : &PL_na) = SvCUR(sv)), SvPVX(sv)) : Perl_sv_2pv(aTHX_ (sv), (lp))) +#endif + +# endif + +#endif + +#if (PERL_BCDVERSION < 0x5007002) + +/* Define sv_2pv_flags for Perl < 5.7.2 which does not have it at all */ + #if defined(PERL_USE_GCC_BRACE_GROUPS) #ifndef sv_2pv_flags -# define sv_2pv_flags(sv, lp, flags) ({ SV *_sv = (sv); const I32 _flags = (flags); STRLEN *_lp = lp; _lp = _lp ? : &PL_na; (!(_flags & SV_GMAGIC) && SvGMAGICAL(_sv)) ? ({ char *_pv; SvGMAGICAL_off(_sv); _pv = sv_2pv(_sv, _lp); SvGMAGICAL_on(_sv); _pv; }) : sv_2pv(_sv, _lp); }) +# define sv_2pv_flags(sv, lp, flags) ({ SV *_sv = (sv); STRLEN sv_2pv_dummy_; const I32 _flags = (flags); STRLEN *_lp = lp; _lp = _lp ? : &sv_2pv_dummy_; (!(_flags & SV_GMAGIC) && SvGMAGICAL(_sv)) ? ({ char *_pv; SvGMAGICAL_off(_sv); _pv = sv_2pv(_sv, _lp); SvGMAGICAL_on(_sv); _pv; }) : sv_2pv(_sv, _lp); }) #endif #ifndef sv_pvn_force_flags -# define sv_pvn_force_flags(sv, lp, flags) ({ SV *_sv = (sv); const I32 _flags = (flags); STRLEN *_lp = lp; _lp = _lp ? : &PL_na; (!(_flags & SV_GMAGIC) && SvGMAGICAL(_sv)) ? ({ char *_pv; SvGMAGICAL_off(_sv); _pv = sv_pvn_force(_sv, _lp); SvGMAGICAL_on(_sv); _pv; }) : sv_pvn_force(_sv, _lp); }) +# define sv_pvn_force_flags(sv, lp, flags) ({ SV *_sv = (sv); STRLEN sv_2pv_dummy_; const I32 _flags = (flags); STRLEN *_lp = lp; _lp = _lp ? : &sv_2pv_dummy_; (!(_flags & SV_GMAGIC) && SvGMAGICAL(_sv)) ? ({ char *_pv; SvGMAGICAL_off(_sv); _pv = sv_pvn_force(_sv, _lp); SvGMAGICAL_on(_sv); _pv; }) : sv_pvn_force(_sv, _lp); }) #endif #else @@ -14419,6 +14494,28 @@ #endif +#elif (PERL_BCDVERSION < 0x5017002) + +/* Fix sv_2pv_flags for Perl < 5.17.2 */ + +# ifdef sv_2pv_flags +# undef sv_2pv_flags +# endif + +# if defined(PERL_USE_GCC_BRACE_GROUPS) +#ifndef sv_2pv_flags +# define sv_2pv_flags(sv, lp, flags) ({ SV *_sv_2pv = (sv); STRLEN sv_2pv_dummy_; const I32 _flags_2pv = (flags); STRLEN *_lp_2pv = (lp); _lp_2pv = _lp_2pv ? : &sv_2pv_dummy_; ((!(_flags_2pv & SV_GMAGIC) || !SvGMAGICAL(_sv_2pv)) && SvPOKp(_sv_2pv)) ? ((*(_lp_2pv) = SvCUR(_sv_2pv)), SvPVX(_sv_2pv)) : Perl_sv_2pv_flags(aTHX_ _sv_2pv, (_lp_2pv), (_flags_2pv)); }) +#endif + +# else +#ifndef sv_2pv_flags +# define sv_2pv_flags(sv, lp, flags) (((!((flags) & SV_GMAGIC) || !SvGMAGICAL(sv)) && SvPOKp(sv)) ? ((*((lp) ? (lp) : &PL_na) = SvCUR(sv)), SvPVX(sv)) : Perl_sv_2pv_flags(aTHX_ (sv), (lp), (flags))) +#endif + +# endif + +#endif + #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) ) # define D_PPP_SVPV_NOLEN_LP_ARG &PL_na #else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV_XS-1.54/t/71_strict.t new/Text-CSV_XS-1.55/t/71_strict.t --- old/Text-CSV_XS-1.54/t/71_strict.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Text-CSV_XS-1.55/t/71_strict.t 2024-06-07 11:27:45.000000000 +0200 @@ -0,0 +1,194 @@ +#!/usr/bin/perl + +use strict; +use warnings; + + use Test::More tests => 56; +#use Test::More "no_plan"; + +my %err; + +BEGIN { + require_ok "Text::CSV_XS"; + plan skip_all => "Cannot load Text::CSV_XS" if $@; + require "./t/util.pl"; + + open my $fh, "<", "CSV_XS.xs" or die "Cannot read error messages from XS\n"; + while (<$fh>) { + m/^ \{ ([0-9]{4}), "([^"]+)"\s+\}/ and $err{$1} = $2; + } + close $fh; + } + +my $tfn = "_80test.csv"; END { -f $tfn and unlink $tfn; } +$| = 1; + +my $csv = Text::CSV_XS->new (); + +{ my $csv = Text::CSV_XS->new ({ strict => 1 }); + ok ($csv->parse ("1,2,3"), "Set strict to 3 columns"); + ok ($csv->parse ("a,b,c"), "3 columns should be correct"); + is ($csv->parse ("3,4"), 0, "Not enough columns"); + is (0 + $csv->error_diag, 2014, "Error set correctly"); + } +{ my $csv = Text::CSV_XS->new ({ strict => 1 }); + ok ($csv->parse ("1,2,3"), "Set strict to 3 columns"); + is ($csv->parse ("3,4,5,6"), 0, "Too many columns"); + is (0 + $csv->error_diag, 2014, "Error set correctly"); + } +{ my $csv = Text::CSV_XS->new ({ strict => 1 }); + open my $fh, ">", $tfn or die "$tfn: $!\n"; + ok ($csv->say ($fh, [ 1, 2, 3 ]), "Write line 1"); + ok ($csv->say ($fh, [ 1, 2, 3 ]), "Write line 2"); + close $fh; + open $fh, "<", $tfn or die "$tfn: $!\n"; + ok ((my $r = $csv->getline ($fh)), "Get line 1 under strict"); + ok (( $r = $csv->getline ($fh)), "Get line 2 under strict"); + is ($csv->getline ($fh), undef, "EOF under strict"); + is (0 + $csv->error_diag, 2012, "Error is 2012 instead of 2014"); + ok ($csv->eof, "EOF is set"); + close $fh; + } +{ my $csv = Text::CSV_XS->new ({ strict => 1 }); + open my $fh, ">", $tfn or die "$tfn: $!\n"; + ok ($csv->say ($fh, [ 1, 2, 3 ]), "Write line 1"); + ok ($csv->print ($fh, [ 1, 2, 3 ]), "Write line 2 no newline"); + close $fh; + open $fh, "<", $tfn or die "$tfn: $!\n"; + ok ((my $r = $csv->getline ($fh)), "Get line 1 under strict"); + ok (( $r = $csv->getline ($fh)), "Get line 2 under strict no newline"); + is ($csv->getline ($fh), undef, "EOF under strict"); + is (0 + $csv->error_diag, 2012, "Error is 2012 instead of 2014"); + ok ($csv->eof, "EOF is set"); + close $fh; + } +{ my $csv = Text::CSV_XS->new (); + open my $fh, ">", $tfn or die "$tfn: $!\n"; + ok ($csv->say ($fh, [ 1 .. 3 ]), "Write line 1 (headers)"); + ok ($csv->say ($fh, [ 1 .. 4 ]), "Write line 2 (data)"); + close $fh; + my $aoh = Text::CSV_XS::csv (in => $tfn, headers => "auto"); + is_deeply ($aoh, [{ 1 => 1, 2 => 2, 3 => 3 }], "Column dropped"); + my @e; + eval { + local $SIG{__WARN__} = sub { push @e => @_ }; + $aoh = Text::CSV_XS::csv (in => $tfn, headers => "auto", strict => 1); + }; + is_deeply ($aoh, [], "Fail under strict"); + is (scalar @e, 1, "Got error"); + like ($e[0], qr{ 2014 }, "Error 2014"); + + open $fh, ">", $tfn or die "$tfn: $!\n"; + ok ($csv->say ($fh, [ 1 .. 4 ]), "Write line 1 (headers)"); + ok ($csv->say ($fh, [ 1 .. 3 ]), "Write line 2 (data)"); + close $fh; + $aoh = Text::CSV_XS::csv (in => $tfn, headers => "auto"); + is_deeply ($aoh, [{ 1 => 1, 2 => 2, 3 => 3, 4 => undef }], "Column added"); + @e = (); + eval { + local $SIG{__WARN__} = sub { push @e => @_ }; + $aoh = Text::CSV_XS::csv (in => $tfn, headers => "auto", strict => 1); + }; + is_deeply ($aoh, [], "Fail under strict"); + is (scalar @e, 1, "Got error"); + like ($e[0], qr{ 2014 }, "Error 2014"); + } + +foreach my $strict (0, 1) { + my $csv = Text::CSV_XS->new ({ + binary => 1, + comment_str => "#", + eol => "\n", + escape_char => '"', + quote_char => '"', + sep_char => "|", + strict => $strict, + }); + + my $status = $csv->parse ('a|b|"d"'); + is (0 + $csv->error_diag, 0, "No fail under strict = $strict"); + $status = $csv->parse ('a|b|c"d"e'); # Loose unescaped quote + is (0 + $csv->error_diag, 2034, "Previous error still actual"); + } + +open my $fh, ">", $tfn or die "$tfn: $!\n"; +print $fh <<"EOC"; +1,foo +2,bar,fail +3,baz +4 +5,eox +EOC +close $fh; + +open $fh, "<", $tfn or die "$tfn: $!\n"; +my @rpt; +$csv = Text::CSV_XS->new ({ strict => 1, auto_diag => 1 }); +$csv->callbacks (error => sub { + my ($err, $msg, $pos, $recno, $fldno) = @_; + if ($err == 2014) { + push @rpt => [ $recno, $fldno, $pos ]; + $csv->SetDiag (0); + } + }); +is_deeply ([ $csv->getline_all ($fh), @rpt ], + [[[ 1, "foo" ], [ 2, "bar", "fail" ], [ 3, "baz" ], [ 4 ], [ 5, "eox" ]], + [ 2, 3, 12 ], [ 4, 1, 3 ]], "Can catch strict 2014 with \$csv"); +close $fh; + +open $fh, "<", $tfn or die "$tfn: $!\n"; +@rpt = (); +$csv = Text::CSV_XS->new ({ strict => 1, auto_diag => 1, callbacks => { + error => sub { + my ($err, $msg, $pos, $recno, $fldno) = @_; + if ($err == 2014) { + push @rpt => [ $recno, $fldno, $pos ]; + Text::CSV_XS->SetDiag (0); + } + }}}); +is_deeply ([ $csv->getline_all ($fh), @rpt ], + [[[ 1, "foo" ], [ 2, "bar", "fail" ], [ 3, "baz" ], [ 4 ], [ 5, "eox" ]], + [ 2, 3, 12 ], [ 4, 1, 3 ]], "Can catch strict 2014 with class"); +close $fh; + +# Under strcict, fail un not enough fields. +# Under non-strict expect the value of the previous record +foreach my $test ( + [ "a,b,c\n" . "d,e,f\n". "g,h\n". "i,j,k\n", + "a,b,c\n" . "d,e,f\n". "g,h,f\n". "i,j,k\n", 2, 5 ], + [ "a,b,c\n" . "d,e,f\n". "g,h\n" , + "a,b,c\n" . "d,e,f\n". "g,h,f\n" , 2, 5 ], + [ "a,b,c\n" . "g,h\n". "i,j,k\n", + "a,b,c\n" . "g,h,c\n". "i,j,k\n", 1, 5 ], + [ "a,b\n" . "d,e,f\n". "g,h\n". "i,j,k\n", + "a,b,*\n" . "d,e,f\n". "g,h,f\n". "i,j,k\n", 1, 5 ], + ) { + my ($dta, $dta0, $err_line, $pos) = @$test; + open $fh, ">", $tfn or die "$tfn: $!\n"; + print $fh $dta; + close $fh; + my $expect = [ map {[ split m/,/ => $_ ]} grep m/\S/ => split "\n" => $dta0 ]; + foreach my $strict (0, 1) { + open $fh, "<", $tfn or die "$tfn: $!\n"; + my $csv = Text::CSV_XS->new ({ strict => $strict }); + my ($r1, $r2, $r3) = ("-", "+", "*"); + $csv->bind_columns (\($r1, $r2, $r3)); + my @out; + eval { + while ($csv->getline ($fh)) { + push @out => [ $r1, $r2, $r3 ]; + } + }; + close $fh; + my @err = $csv->error_diag; + if ($strict) { + is ($err[0], 2014, "ENF"); + splice @$expect, $err_line; + } + else { + is ($err[0], 2012, "EOF"); + } + is_deeply (\@out, $expect, "Bound + strict = $strict"); + } + } + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV_XS-1.54/t/79_callbacks.t new/Text-CSV_XS-1.55/t/79_callbacks.t --- old/Text-CSV_XS-1.54/t/79_callbacks.t 2021-04-14 14:35:59.000000000 +0200 +++ new/Text-CSV_XS-1.55/t/79_callbacks.t 2024-06-07 11:24:23.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; - use Test::More tests => 113; + use Test::More tests => 111; #use Test::More "no_plan"; BEGIN { @@ -162,46 +162,6 @@ is_deeply ($csv->getline_all ($fh), [[1,"foo"],[2,"bar"],[4,"zoo"]], "skip"); close $fh; -open $fh, ">", $tfn or die "$tfn: $!\n"; -print $fh <<"EOC"; -1,foo -2,bar,fail -3,baz -4 -5,eox -EOC -close $fh; - -open $fh, "<", $tfn or die "$tfn: $!\n"; -my @rpt; -$csv = Text::CSV_XS->new ({ strict => 1, auto_diag => 1 }); -$csv->callbacks (error => sub { - my ($err, $msg, $pos, $recno, $fldno) = @_; - if ($err == 2014) { - push @rpt => [ $recno, $fldno, $pos ]; - $csv->SetDiag (0); - } - }); -is_deeply ([ $csv->getline_all ($fh), @rpt ], - [[[ 1, "foo" ], [ 2, "bar", "fail" ], [ 3, "baz" ], [ 4 ], [ 5, "eox" ]], - [ 2, 3, 12 ], [ 4, 1, 3 ]], "Can catch strict 2014 with \$csv"); -close $fh; - -open $fh, "<", $tfn or die "$tfn: $!\n"; -@rpt = (); -$csv = Text::CSV_XS->new ({ strict => 1, auto_diag => 1, callbacks => { - error => sub { - my ($err, $msg, $pos, $recno, $fldno) = @_; - if ($err == 2014) { - push @rpt => [ $recno, $fldno, $pos ]; - Text::CSV_XS->SetDiag (0); - } - }}}); -is_deeply ([ $csv->getline_all ($fh), @rpt ], - [[[ 1, "foo" ], [ 2, "bar", "fail" ], [ 3, "baz" ], [ 4 ], [ 5, "eox" ]], - [ 2, 3, 12 ], [ 4, 1, 3 ]], "Can catch strict 2014 with class"); -close $fh; - __END__ 1,foo 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Text-CSV_XS-1.54/t/80_diag.t new/Text-CSV_XS-1.55/t/80_diag.t --- old/Text-CSV_XS-1.54/t/80_diag.t 2024-03-29 10:38:21.000000000 +0100 +++ new/Text-CSV_XS-1.55/t/80_diag.t 2024-06-07 11:20:40.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; - use Test::More tests => 347; + use Test::More tests => 314; #use Test::More "no_plan"; my %err; @@ -253,75 +253,6 @@ is (0 + $csv->error_diag, 1001, "Cannot set sep to current sep"); } -{ my $csv = Text::CSV_XS->new ({ strict => 1 }); - ok ($csv->parse ("1,2,3"), "Set strict to 3 columns"); - ok ($csv->parse ("a,b,c"), "3 columns should be correct"); - is ($csv->parse ("3,4"), 0, "Not enough columns"); - is (0 + $csv->error_diag, 2014, "Error set correctly"); - } -{ my $csv = Text::CSV_XS->new ({ strict => 1 }); - ok ($csv->parse ("1,2,3"), "Set strict to 3 columns"); - is ($csv->parse ("3,4,5,6"), 0, "Too many columns"); - is (0 + $csv->error_diag, 2014, "Error set correctly"); - } -{ my $csv = Text::CSV_XS->new ({ strict => 1 }); - open my $fh, ">", $tfn or die "$tfn: $!\n"; - ok ($csv->say ($fh, [ 1, 2, 3 ]), "Write line 1"); - ok ($csv->say ($fh, [ 1, 2, 3 ]), "Write line 2"); - close $fh; - open $fh, "<", $tfn or die "$tfn: $!\n"; - ok ((my $r = $csv->getline ($fh)), "Get line 1 under strict"); - ok (( $r = $csv->getline ($fh)), "Get line 2 under strict"); - is ($csv->getline ($fh), undef, "EOF under strict"); - is (0 + $csv->error_diag, 2012, "Error is 2012 instead of 2014"); - ok ($csv->eof, "EOF is set"); - close $fh; - } -{ my $csv = Text::CSV_XS->new ({ strict => 1 }); - open my $fh, ">", $tfn or die "$tfn: $!\n"; - ok ($csv->say ($fh, [ 1, 2, 3 ]), "Write line 1"); - ok ($csv->print ($fh, [ 1, 2, 3 ]), "Write line 2 no newline"); - close $fh; - open $fh, "<", $tfn or die "$tfn: $!\n"; - ok ((my $r = $csv->getline ($fh)), "Get line 1 under strict"); - ok (( $r = $csv->getline ($fh)), "Get line 2 under strict no newline"); - is ($csv->getline ($fh), undef, "EOF under strict"); - is (0 + $csv->error_diag, 2012, "Error is 2012 instead of 2014"); - ok ($csv->eof, "EOF is set"); - close $fh; - } -{ my $csv = Text::CSV_XS->new (); - open my $fh, ">", $tfn or die "$tfn: $!\n"; - ok ($csv->say ($fh, [ 1 .. 3 ]), "Write line 1 (headers)"); - ok ($csv->say ($fh, [ 1 .. 4 ]), "Write line 2 (data)"); - close $fh; - my $aoh = Text::CSV_XS::csv (in => $tfn, headers => "auto"); - is_deeply ($aoh, [{ 1 => 1, 2 => 2, 3 => 3 }], "Column dropped"); - my @e; - eval { - local $SIG{__WARN__} = sub { push @e => @_ }; - $aoh = Text::CSV_XS::csv (in => $tfn, headers => "auto", strict => 1); - }; - is_deeply ($aoh, [], "Fail under strict"); - is (scalar @e, 1, "Got error"); - like ($e[0], qr{ 2014 }, "Error 2014"); - - open $fh, ">", $tfn or die "$tfn: $!\n"; - ok ($csv->say ($fh, [ 1 .. 4 ]), "Write line 1 (headers)"); - ok ($csv->say ($fh, [ 1 .. 3 ]), "Write line 2 (data)"); - close $fh; - $aoh = Text::CSV_XS::csv (in => $tfn, headers => "auto"); - is_deeply ($aoh, [{ 1 => 1, 2 => 2, 3 => 3, 4 => undef }], "Column added"); - @e = (); - eval { - local $SIG{__WARN__} = sub { push @e => @_ }; - $aoh = Text::CSV_XS::csv (in => $tfn, headers => "auto", strict => 1); - }; - is_deeply ($aoh, [], "Fail under strict"); - is (scalar @e, 1, "Got error"); - like ($e[0], qr{ 2014 }, "Error 2014"); - } - { my $csv = Text::CSV_XS->new; eval { $csv->header (undef, "foo"); }; is (0 + $csv->error_diag, 1014, "Cannot read header from undefined source");