Skip to content

locale.c: S_save_to_buffer: Add pTHX parameter #21364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -4348,7 +4348,7 @@ So |void |restore_toggled_locale_i \
|const unsigned cat_index \
|NULLOK const char *original_locale \
|const line_t caller_line
ST |const char *|save_to_buffer \
S |const char *|save_to_buffer \
|NULLOK const char *string \
|NULLOK const char **buf \
|NULLOK Size_t *buf_size
Expand Down
2 changes: 1 addition & 1 deletion embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@
# define get_category_index_helper(a,b,c) S_get_category_index_helper(aTHX_ a,b,c)
# define mortalized_pv_copy(a) S_mortalized_pv_copy(aTHX_ a)
# define new_LC_ALL(a,b) S_new_LC_ALL(aTHX_ a,b)
# define save_to_buffer S_save_to_buffer
# define save_to_buffer(a,b,c) S_save_to_buffer(aTHX_ a,b,c)
# define setlocale_failure_panic_via_i(a,b,c,d,e,f,g) S_setlocale_failure_panic_via_i(aTHX_ a,b,c,d,e,f,g)
# if defined(DEBUGGING)
# define my_setlocale_debug_string_i(a,b,c,d) S_my_setlocale_debug_string_i(aTHX_ a,b,c,d)
Expand Down
13 changes: 4 additions & 9 deletions locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -4063,7 +4063,7 @@ S_is_locale_utf8(pTHX_ const char * locale)
#ifdef USE_LOCALE

STATIC const char *
S_save_to_buffer(const char * string, const char **buf, Size_t *buf_size)
S_save_to_buffer(pTHX_ const char * string, const char **buf, Size_t *buf_size)
{
/* Copy the NUL-terminated 'string' to a buffer whose address before this
* call began at *buf, and whose available length before this call was
Expand Down Expand Up @@ -4113,23 +4113,18 @@ S_save_to_buffer(const char * string, const char **buf, Size_t *buf_size)
*buf_size = string_size;
}

{
dTHX_DEBUGGING;
DEBUG_Lv(PerlIO_printf(Perl_debug_log,
# ifdef DEBUGGING

DEBUG_Lv(PerlIO_printf(Perl_debug_log,
"Copying '%s' to %p\n",
((is_utf8_string((U8 *) string, 0))
? string
:_byte_dump_string((U8 *) string, strlen(string), 0)),
*buf));
}

# ifdef DEBUGGING

/* Catch glitches. Usually this is because LC_CTYPE needs to be the same
* locale as whatever is being worked on */
if (UNLIKELY(instr(string, REPLACEMENT_CHARACTER_UTF8))) {
dTHX_DEBUGGING;

locale_panic_(Perl_form(aTHX_
"Unexpected REPLACEMENT_CHARACTER in '%s'\n%s",
string, get_LC_ALL_display()));
Expand Down
2 changes: 1 addition & 1 deletion proto.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.