This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for a951350815 (PerlIO-scalar)
[perl5.git] / ext / I18N-Langinfo / Langinfo.xs
index 2cdc50c..8b1fd5a 100644 (file)
@@ -1,3 +1,5 @@
+#define PERL_NO_GET_CONTEXT
+
 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
@@ -16,18 +18,12 @@ PROTOTYPES: ENABLE
 INCLUDE: const-xs.inc
 
 SV*
-internal_langinfo(code)
+langinfo(code)
        int     code
+  PROTOTYPE: _
   CODE:
 #ifdef HAS_NL_LANGINFO
-       {
-         char *s;
-
-         if ((s = nl_langinfo(code)))
-             RETVAL = newSVpvn(s, strlen(s));
-         else
-             RETVAL = &PL_sv_undef;
-       }
+       RETVAL = newSVpv(nl_langinfo(code), 0);
 #else
        croak("nl_langinfo() not implemented on this architecture");
 #endif