summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/POSIX/POSIX.xs23
-rw-r--r--ext/POSIX/lib/POSIX.pm2
-rw-r--r--ext/POSIX/lib/POSIX.pod11
3 files changed, 14 insertions, 22 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index cd8447e825..ec409c06fd 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -3437,24 +3437,11 @@ void
strxfrm(src)
SV * src
CODE:
- {
- STRLEN srclen;
- STRLEN dstlen;
- STRLEN buflen;
- char *p = SvPV(src,srclen);
- srclen++;
- buflen = srclen * 4 + 1;
- ST(0) = sv_2mortal(newSV(buflen));
- dstlen = strxfrm(SvPVX(ST(0)), p, (size_t)buflen);
- if (dstlen >= buflen) {
- dstlen++;
- SvGROW(ST(0), dstlen);
- strxfrm(SvPVX(ST(0)), p, (size_t)dstlen);
- dstlen--;
- }
- SvCUR_set(ST(0), dstlen);
- SvPOK_only(ST(0));
- }
+#ifdef USE_LOCALE_COLLATE
+ ST(0) = Perl_strxfrm(aTHX_ src);
+#else
+ ST(0) = src;
+#endif
SysRet
mkfifo(filename, mode)
diff --git a/ext/POSIX/lib/POSIX.pm b/ext/POSIX/lib/POSIX.pm
index aabb03cd2e..c99bb35f11 100644
--- a/ext/POSIX/lib/POSIX.pm
+++ b/ext/POSIX/lib/POSIX.pm
@@ -4,7 +4,7 @@ use warnings;
our ($AUTOLOAD, %SIGRT);
-our $VERSION = '2.08';
+our $VERSION = '2.09';
require XSLoader;
diff --git a/ext/POSIX/lib/POSIX.pod b/ext/POSIX/lib/POSIX.pod
index d14f53247e..6ef6dc66d5 100644
--- a/ext/POSIX/lib/POSIX.pod
+++ b/ext/POSIX/lib/POSIX.pod
@@ -1972,9 +1972,14 @@ Used with C<eq> or C<cmp> as an alternative to C<L</strcoll>>.
Not really needed since Perl can do this transparently, see
L<perllocale>.
-Beware that in a UTF-8 locale, anything you pass to this function must
-be in UTF-8; and when not in a UTF-8 locale, anything passed must not be
-UTF-8 encoded.
+Unlike the libc C<strxfrm>, this allows NUL characters in the input
+C<$src>.
+
+It doesn't make sense for a string to be encoded in one locale (say,
+ISO-8859-6, Arabic) and to collate it based on another (like ISO-8859-7,
+Greek). Perl assumes that the current C<LC_CTYPE> locale correctly
+represents the encoding of C<$src>, and ignores the value of
+C<LC_COLLATE>.
=item C<sysconf>