/* The native Windows implementation of setlocale understands the special
locale name "C", but not "POSIX". Therefore map "POSIX" to "C". */
- if (locale != NULL && strcmp (locale, "POSIX") == 0)
+ if (locale != NULL && streq (locale, "POSIX"))
locale = "C";
/* The native Windows implementation of setlocale, in the UTF-8 environment,
but it understands "English_United States.65001", which is functionally
equivalent. */
if (locale != NULL
- && ((is_utf8 && strcmp (locale, "C") == 0)
- || strcmp (locale, "C.UTF-8") == 0))
+ && ((is_utf8 && streq (locale, "C"))
+ || streq (locale, "C.UTF-8")))
locale = "English_United States.65001";
/* First, try setlocale with the original argument unchanged. */
/* llCC_buf now contains
language[_territory][@modifier]
*/
- if (strcmp (llCC_buf, locale) != 0)
+ if (!streq (llCC_buf, locale))
{
if (is_utf8)
{
case LC_TELEPHONE:
case LC_MEASUREMENT:
if (locale == NULL
- || strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
+ || streq (locale, "C") || streq (locale, "POSIX"))
result = (char *) "C";
break;
default:
LC_CTYPE category to an invalid value ("C") when it does not
support the specified encoding. Report a failure instead. */
if (strchr (base_name, '.') != NULL
- && strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ && streq (setlocale (LC_CTYPE, NULL), "C"))
goto fail;
# endif
/* If name is the same as base_name, it has already been set
through the setlocale call before the loop. */
- if (strcmp (name, base_name) != 0
+ if (!streq (name, base_name)
# if LC_MESSAGES == 1729
|| cat == LC_MESSAGES
# endif
set the LC_CTYPE category to an invalid value ("C") when
it does not support the specified encoding. Report a
failure instead. */
- if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ if (streq (setlocale (LC_CTYPE, NULL), "C"))
{
/* Don't risk an endless recursion. */
if (saved_locale[0] != '\0')
{
char *name1 = setlocale (LC_ALL, NULL);
char *name2 = setlocale_single (LC_MESSAGES, NULL);
- if (strcmp (name1, name2) == 0)
+ if (streq (name1, name2))
/* Not a mixed locale. */
return name1;
else