From 7bee57f6d73fe07d73dd9b4a538e4ffd60c7eed8 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 3 May 2011 09:52:49 -0600 Subject: [PATCH] embed.fnc: Allow NULL arg to to_utf8_case() Code within the function doesn't assume that the parameter is non-null, and in fact the specials are retrieved by swash_init(). Having the parameter null just means that no specials will be retrieved in the current call. --- embed.fnc | 2 +- proto.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/embed.fnc b/embed.fnc index b891b43..288dacd 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1318,7 +1318,7 @@ EsMR |HV* |invlist_union |NN HV* const a|NN HV* const b Ap |void |taint_env Ap |void |taint_proper |NULLOK const char* f|NN const char *const s Apd |UV |to_utf8_case |NN const U8 *p|NN U8* ustrp|NULLOK STRLEN *lenp \ - |NN SV **swashp|NN const char *normal|NN const char *special + |NN SV **swashp|NN const char *normal|NULLOK const char *special Apd |UV |to_utf8_lower |NN const U8 *p|NN U8* ustrp|NULLOK STRLEN *lenp Apd |UV |to_utf8_upper |NN const U8 *p|NN U8* ustrp|NULLOK STRLEN *lenp Apd |UV |to_utf8_title |NN const U8 *p|NN U8* ustrp|NULLOK STRLEN *lenp diff --git a/proto.h b/proto.h index a8c066a..0553531 100644 --- a/proto.h +++ b/proto.h @@ -4253,10 +4253,9 @@ PERL_CALLCONV UV Perl_to_utf8_case(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, S __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2) __attribute__nonnull__(pTHX_4) - __attribute__nonnull__(pTHX_5) - __attribute__nonnull__(pTHX_6); + __attribute__nonnull__(pTHX_5); #define PERL_ARGS_ASSERT_TO_UTF8_CASE \ - assert(p); assert(ustrp); assert(swashp); assert(normal); assert(special) + assert(p); assert(ustrp); assert(swashp); assert(normal) PERL_CALLCONV UV Perl_to_utf8_fold(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp) __attribute__nonnull__(pTHX_1) -- 2.7.4