This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ExtUtils::Install was upgraded to 1.65 by 9345802d17
[perl5.git] / inline.h
index a5742b8..518d8da 100644 (file)
--- a/inline.h
+++ b/inline.h
@@ -244,7 +244,7 @@ S_bootstrap_ctype(U8 character, UV classnum, bool full_Latin1)
 
         default: break;
     }
-    Perl_croak(aTHX_ "panic: bootstrap_ctype() has an unexpected character class '%"UVxf"'", classnum);
+    Perl_croak(aTHX_ "panic: bootstrap_ctype() has an unexpected character class '%" UVxf "'", classnum);
 }
 #endif
 
@@ -258,7 +258,7 @@ S_append_utf8_from_native_byte(const U8 byte, U8** dest)
 
     PERL_ARGS_ASSERT_APPEND_UTF8_FROM_NATIVE_BYTE;
 
-    if (NATIVE_IS_INVARIANT(byte))
+    if (NATIVE_BYTE_IS_INVARIANT(byte))
         *(*dest)++ = byte;
     else {
         *(*dest)++ = UTF8_EIGHT_BIT_HI(byte);
@@ -288,7 +288,7 @@ S_isALNUM_lazy(pTHX_ const char* p)
 /* ------------------------------- perl.h ----------------------------- */
 
 /*
-=for apidoc AiR|bool|is_safe_syscall|SV *pv|const char *what|const char *op_name
+=for apidoc AiR|bool|is_safe_syscall|const char *pv|STRLEN len|const char *what|const char *op_name
 
 Test that the given C<pv> doesn't contain any internal NUL characters.
 If it does, set C<errno> to ENOENT, optionally warn, and return FALSE.
@@ -301,21 +301,20 @@ Used by the IS_SAFE_SYSCALL() macro.
 */
 
 PERL_STATIC_INLINE bool
-S_is_safe_syscall(pTHX_ SV *pv, const char *what, const char *op_name) {
+S_is_safe_syscall(pTHX_ const char *pv, STRLEN len, const char *what, const char *op_name) {
     /* While the Windows CE API provides only UCS-16 (or UTF-16) APIs
      * perl itself uses xce*() functions which accept 8-bit strings.
      */
 
     PERL_ARGS_ASSERT_IS_SAFE_SYSCALL;
 
-    if (SvPOK(pv) && SvCUR(pv) >= 1) {
-        char *p = SvPVX(pv);
+    if (pv && len > 1) {
         char *null_at;
-        if (UNLIKELY((null_at = (char *)memchr(p, 0, SvCUR(pv)-1)) != NULL)) {
+        if (UNLIKELY((null_at = (char *)memchr(pv, 0, len-1)) != NULL)) {
                 SETERRNO(ENOENT, LIB_INVARG);
                 Perl_ck_warner(aTHX_ packWARN(WARN_SYSCALLS),
                                    "Invalid \\0 character in %s for %s: %s\\0%s",
-                                   what, op_name, p, null_at+1);
+                                   what, op_name, pv, null_at+1);
                 return FALSE;
         }
     }