summaryrefslogtreecommitdiff
path: root/ext/PerlIO-encoding/encoding.pm
Commit message (Collapse)AuthorAgeFilesLines
* PerlIO-encoding - add parens to silence build warningsYves Orton2021-02-121-1/+1
|
* Enforce STOP_AT_PARTIAL in $PerlIO::encoding::fallbackLeon Timmermans2021-01-301-3/+2
| | | | | | | | | | | | PerlIO::encoding has a $fallback variable that allows one to set the behavior on a encoding/decoding error, for example to make it throw an exception on error. What is not documented (actually the example in the documentation is even missing this) is that PerlIO::encoding needs the (equally undocumented) Encode::STOP_AT_PARTIAL flag to be set, otherwise a multi-byte character spanning buffer boundaries will be interpreted as two invalid byte sequences. I could have fixed the documentation, but instead I fixed the code to always pass this flag to Encode, simplifying the use and making the current documentation correct again.
* Fix "it it" typosDagfinn Ilmari Mannsåker2019-07-041-1/+1
| | | | And regen affected files
* bump $PerlIO::encoding::VERSIONTony Cook2019-02-251-1/+1
|
* PerlIO::encoding: Use Encode::ONLY_PRAGMA_WARNINGS in fallback by defaultPali2019-02-251-1/+1
| | | | | This would enable to respect utf8 warnings enabled/disabled by pramga warnings when processing filehandle with :encoding layer.
* don't clobber file bytes in :encoding layerZefram2018-02-161-1/+1
| | | | | | | | | | | The PerlIO::encoding layer, when used on input, was creating an SvLEN==0 scalar pointing into the byte buffer, to pass to the ->decode method of the encoding object. Since the method mutates this scalar, for some encodings this led to mutating the byte buffer, and depending on where it came from that might be something visible elsewhere that should not be mutated. Remove the code for the SvLEN==0 scalar, instead always using the alternate code that would copy the bytes into a separate buffer owned by the scalar. Fixes [perl #132833].
* Change sv_setpvn(…, "…", …) to sv_setpvs(…, "…")Dagfinn Ilmari Mannsåker2016-09-211-1/+1
| | | | | The dual-life dists affected use Devel::PPPort, so can safely use sv_setpvs() even though it wasn't added until Perl v5.10.0.
* PerlIO::encoding: explicitly cast char * to STDCHAR *Lukas Mai2016-01-311-1/+1
| | | | | This should avoid the "pointer targets in assignment differ in signedness" warning that pops up in some configurations.
* XS staticing in ext and distDaniel Dragan2015-10-261-1/+1
| | | | | | | None of these symbols are exported on Win32 (listed in Makefile.PL with EUMM's FUNCLIST), so they shouldn't be exported on Linux. Making them static saves space in the SOs by removing symbol name strings, and removing runtime plt/got indirection.
* Properly duplicate PerlIO::encoding objectsVincent Pit2015-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | PerlIO::encoding objects are usually initialized by calling Perl methods, essentially from the pushed() and getarg() callbacks. During cloning, the PerlIO API will by default call these methods to initialize the duplicate struct when the PerlIOBase parent struct is itself duplicated. This does not behave so well because the perl interpreter is not ready to call methods at this point, for the stacks are not set up yet. The proper way to duplicate the PerlIO::encoding object is to call sv_dup() on its members from the dup() PerlIO callback. So the only catch is to make the getarg() and pushed() calls implied by the duplication of the underlying PerlIOBase object aware that they are called during cloning, and make them wait that the control flow returns to the dup() callback. Fortunately, getarg() knows since its param argument is then non-null, and its return value is passed immediately to pushed(), so it is enough to tag this returned value with a custom magic so that pushed() can see it is being called during cloning. This fixes [RT #31923].
* const a PERLIO vtable in PerlIO::encodingDaniel Dragan2015-01-051-1/+1
| | | | | This makes PerlIO::encoding's shared library free of any perl caused RW static data.
* Increase $PerlIO::encoding::VERSION to 0.20Father Chrysostomos2014-11-021-1/+1
|
* bump $VERSION for PerlIO-encoding, PerlIO-mmap, PerlIO-scalar, OS2-ProcessTony Cook2014-06-121-1/+1
|
* Purge sfio support, which has been broken for a decade.Nicholas Clark2013-12-271-1/+1
| | | | | | | | | | | The last Perl release that built with -Dusesfio was v5.8.0, and even that failed many regression tests. Every subsequent release fails to build, and in the decade that has passed we have had no bug reports about this. So it's safe to delete all the code. The Configure related code will be purged in a subsequent commit. 2 references to sfio intentionally remain in fakesdio.h and nostdio.h, as these appear to be for using its stdio API-compatibility layer.
* Remove redundant SPAGAIN & PUTBACK after PUSHSTACKi().Nicholas Clark2013-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PUSHSTACKi() calls SWITCHSTACK(), which sets PL_stack_sp and sp like this: sp = PL_stack_sp = PL_stack_base + AvFILLp(t) Hence after PUSHSTACKi() both are identical, so use of SPAGAIN or PUTBACK to assign one to the other is redundant. The use of SPAGAIN in encoding.xs and via.xs was added with commit 24f59afc531955e5 (April 2002) which added the use of PUSHSTACKi(). It feels like cargo-cult. The use of PUTBACK in Perl_amagic_call() predates the introduction of nested stacks and PUSHSTACKi() in commit e336de0d01f30cc4 (April 1998). It dates from perl 5.000, but it's not clear that it was ever needed, as the code in question looked like this, and nothing could have moved the stack between the dSP and PUTBACK: dSP; BINOP myop; SV* res; Zero(&myop, 1, BINOP); myop.op_last = (OP *) &myop; myop.op_next = Nullop; myop.op_flags = OPf_KNOW|OPf_STACKED; ENTER; SAVESPTR(op); op = (OP *) &myop; PUTBACK; The PUTBACK and SPAGAIN in Perl_require_pv() were added by commit d3acc0f7e5197310 (June 1998) which also added the PUSHSTACKi(). They have both been redundant since they were added.
* Increase $PerlIO::encoding::VERSION to 0.16Father Chrysostomos2012-10-051-1/+1
|
* Bump the version of PerlIO::encoding following 1c2e8ccaafb0b2b1.Nicholas Clark2011-05-201-1/+1
| | | | 1c2e8ccaafb0b2b1 fixed a typo in a comment in the XS code.
* Version bumps for modules changed by a6d37805ca8a9ba8 ($Id$ removal).Nicholas Clark2010-12-161-1/+1
|
* Convert modules in ext/ to pass minimal arguments to XSLoader::load().Nicholas Clark2010-10-141-3/+3
|
* Bump version of PerlIO::encodingRafael Garcia-Suarez2010-01-151-1/+1
|
* Rename ext/PerlIO/encoding to ext/PerlIO-encodingNicholas Clark2009-02-091-0/+53