Skip to content

Commit

Permalink
Fix wretest locale check.
Browse files Browse the repository at this point in the history
While here, remove the comment about FreeBSD, since it is not alone in
omitting the first hyphen, and most Linux distributions will happily
accept both spellings.
  • Loading branch information
dag-erling committed Apr 26, 2024
1 parent 1731353 commit 49b1876
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/retest.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,8 @@ main(int argc, char **argv)
#ifdef WRETEST
/* Need an 8-bit locale. Or move the two tests with non-ascii
characters to the localized internationalization tests. */
if (setlocale(LC_CTYPE, "en_US.ISO-8859-1") == NULL)
if (setlocale(LC_CTYPE, "en_US.ISO-8859-1") == NULL &&
setlocale(LC_CTYPE, "en_US.ISO8859-1") == NULL)
fprintf(stderr, "Could not set locale en_US.ISO-8859-1. Expect some\n"
"`Invalid or incomplete multi-byte sequence' errors.\n");
#endif /* WRETEST */
Expand Down Expand Up @@ -1724,7 +1725,7 @@ main(int argc, char **argv)

#if !defined(WIN32) && !defined(__OpenBSD__)
if (setlocale(LC_CTYPE, "en_US.ISO-8859-1") != NULL ||
setlocale(LC_CTYPE, "en_US.ISO8859-1" /* FreeBSD seems to spell it differently */) != NULL)
setlocale(LC_CTYPE, "en_US.ISO8859-1") != NULL)
{
fprintf(output_fd,"\nTesting LC_CTYPE en_US.ISO-8859-1\n");
#ifdef SRC_IN_ISO_8859_1
Expand Down

0 comments on commit 49b1876

Please sign in to comment.