Skip to content

Commit 77609fd

Browse files
committed
Rename isQUOTEMETA to isQUOTEMETA_
The former is undefined behavior in C in some situations.
1 parent af99360 commit 77609fd

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

ext/XS-APItest/APItest.xs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6723,7 +6723,7 @@ test_UTF8_IS_REPLACEMENT(char *s, STRLEN len)
67236723
bool
67246724
test_isQUOTEMETA(UV ord)
67256725
CODE:
6726-
RETVAL = _isQUOTEMETA(ord);
6726+
RETVAL = isQUOTEMETA_(ord);
67276727
OUTPUT:
67286728
RETVAL
67296729

handy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ END_EXTERN_C
16911691
( (! cBOOL(FITS_IN_8_BITS(c))) \
16921692
|| (PL_charclass[(U8) (c)] & CC_mask_(CC_NONLATIN1_FOLD_)))
16931693

1694-
# define _isQUOTEMETA(c) generic_isCC_(c, CC_QUOTEMETA_)
1694+
# define isQUOTEMETA_(c) generic_isCC_(c, CC_QUOTEMETA_)
16951695

16961696
/* is c a control character for which we have a mnemonic? */
16971697
# if defined(PERL_CORE) || defined(PERL_EXT)

pp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5073,7 +5073,7 @@ PP(pp_quotemeta)
50735073
bool to_quote = FALSE;
50745074

50755075
if (UTF8_IS_INVARIANT(*s)) {
5076-
if (_isQUOTEMETA(*s)) {
5076+
if (isQUOTEMETA_(*s)) {
50775077
to_quote = TRUE;
50785078
}
50795079
}
@@ -5086,7 +5086,7 @@ PP(pp_quotemeta)
50865086
IN_LC_RUNTIME(LC_CTYPE)
50875087
||
50885088
#endif
5089-
_isQUOTEMETA(EIGHT_BIT_UTF8_TO_NATIVE(*s, *(s + 1))))
5089+
isQUOTEMETA_(EIGHT_BIT_UTF8_TO_NATIVE(*s, *(s + 1))))
50905090
{
50915091
to_quote = TRUE;
50925092
}
@@ -5108,7 +5108,7 @@ PP(pp_quotemeta)
51085108
}
51095109
else if (IN_UNI_8_BIT) {
51105110
while (len--) {
5111-
if (_isQUOTEMETA(*s))
5111+
if (isQUOTEMETA_(*s))
51125112
*d++ = '\\';
51135113
*d++ = *s++;
51145114
}

0 commit comments

Comments
 (0)