This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Remove redundant handling of the AM_PM format
authorKarl Williamson <khw@cpan.org>
Thu, 28 Dec 2023 16:16:59 +0000 (09:16 -0700)
committerKarl Williamson <khw@cpan.org>
Mon, 8 Jan 2024 22:41:59 +0000 (15:41 -0700)
This format is identical whether or not LC_TIME is usable on this
platform or not.  Previously, it was actually handled in two functions,
emulate_langinfo() when LC_TIME is usable, and Perl_langinfo8() when
not.  Previous commits have enabled the format handling in
emulate_langinfo() to be returned instead of having separate cases,
depending on LC_TIME's availability.  That means the handling of this
format in Perl_langinfo8() is redundant and this commit removes it.

locale.c

index f4c1072..c20cc2e 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -5951,16 +5951,11 @@ Perl_langinfo8(const nl_item item, utf8ness_t * utf8ness)
        * them, and so are returned unconditionally; they may not be what the
        * locale actually says, but should give good enough results for someone
        * using them as formats (as opposed to trying to parse them to figure
-       * out what the locale says).  The other format is actually tested
-       * to verify it works on the platform */
+       * out what the locale says). */
       case D_FMT:         return "%x";
       case T_FMT:         return "%X";
       case D_T_FMT:       return "%c";
 
-#  ifndef USE_LOCALE_TIME
-
-      case T_FMT_AMPM:    return "%r";
-#  endif
 #endif
 
     } /* End of switch on item */