summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2023-04-30 20:36:56 -0600
committerKarl Williamson <khw@cpan.org>2023-05-01 06:40:14 -0600
commit5f951aa0d5804e69ae58fd3c1619b26a5abb3c13 (patch)
treef39f2a624742c7719d3c27e92714cd09165b9c79 /locale.c
parent265a3a4170eb43b0731b6ebd8f14bb25b02cd2e5 (diff)
downloadperl-5f951aa0d5804e69ae58fd3c1619b26a5abb3c13.tar.gz
Remove my_strftime8()
The comment from Tony Cook https://github.com/Perl/perl5/issues/20373#issuecomment-1524256091 made me realize that this function doesn't fully work. It was added as public API earlier in the 5.37 series, but we don't want it making it into a stable release. This commit renames it so that the original name will no longer work, but POSIX.xs can still, by changing to use the new name.name
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/locale.c b/locale.c
index 2005c000a4..73652a3f0e 100644
--- a/locale.c
+++ b/locale.c
@@ -4510,7 +4510,7 @@ S_my_langinfo_i(pTHX_
/* The year was deliberately chosen so that January 1 is on the
* first day of the week. Since we're only getting one thing at a
* time, it all works */
- const char * temp = my_strftime8(format, 30, 30, hour, mday, mon,
+ const char * temp = my_strftime8_temp(format, 30, 30, hour, mday, mon,
2011, 0, 0, 0, &is_utf8);
retval = save_to_buffer(temp, retbufp, retbuf_sizep);
Safefree(temp);
@@ -4804,22 +4804,16 @@ Perl_my_strftime(pTHX_ const char *fmt, int sec, int min, int hour, int mday, in
/*
=for apidoc_section $time
=for apidoc my_strftime
-=for apidoc_item my_strftime8
strftime(), but with a different API so that the return value is a pointer
to the formatted result (which MUST be arranged to be FREED BY THE
-CALLER). This allows these functions to increase the buffer size as needed,
+CALLER). This allows this function to increase the buffer size as needed,
so that the caller doesn't have to worry about that.
-C<my_strftime8> is the same as plain C<my_strftime>, but has an extra
-parameter, a pointer to a variable declared as L</C<utf8ness_t>>.
-Upon return, its variable will be set to indicate how the resultant string
-should be treated with regards to its UTF-8ness.
-
-Note that yday and wday effectively are ignored by these functions, as
+Note that yday and wday effectively are ignored by this function, as
mini_mktime() overwrites them
-Also note that they are always executed in the underlying locale of the program,
+Also note that it is always executed in the underlying locale of the program,
giving localized results. Mojibake can result on some platforms if LC_CTYPE
and LC_TIME are not the same locale.
@@ -4955,14 +4949,14 @@ and LC_TIME are not the same locale.
}
char *
-Perl_my_strftime8(pTHX_ const char *fmt, int sec, int min, int hour, int mday,
+Perl_my_strftime8_temp(pTHX_ const char *fmt, int sec, int min, int hour, int mday,
int mon, int year, int wday, int yday, int isdst,
utf8ness_t * utf8ness)
{ /* Documented above */
char * retval = my_strftime(fmt, sec, min, hour, mday, mon, year, wday,
yday, isdst);
- PERL_ARGS_ASSERT_MY_STRFTIME8;
+ PERL_ARGS_ASSERT_MY_STRFTIME8_TEMP;
if (utf8ness) {