Cygwin: /proc/locales: filter out useless explicit utf8 locales

Fixes: c42b98bdc6 ("Cygwin: introduce /proc/codesets and /proc/locales")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2023-03-26 14:12:13 +02:00
parent 2d5492453a
commit 80cea27942
1 changed files with 6 additions and 4 deletions

View File

@ -2240,8 +2240,9 @@ format_proc_locale_proc (LPWSTR win_locale, DWORD info, LPARAM param)
__set_charset_from_locale (posix_loc_and_modifier, codeset);
*bufptr_p = add_locale (*bufptr_p, posix_loc, codeset, false, modifier,
win_locale);
*bufptr_p = add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifier,
win_locale);
if (strcmp (codeset, "UTF-8") != 0)
*bufptr_p = add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifier,
win_locale);
/* Only one cross each */
if (modifier[0])
@ -2274,8 +2275,9 @@ format_proc_locale_proc (LPWSTR win_locale, DWORD info, LPARAM param)
__set_charset_from_locale (posix_loc_and_modifier, codeset);
*bufptr_p = add_locale (*bufptr_p, posix_loc, codeset, false, modifier,
win_locale);
*bufptr_p = add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifier,
win_locale);
if (strcmp (codeset, "UTF-8") != 0 && strcmp (modifier, "@euro") != 0)
*bufptr_p = add_locale (*bufptr_p, posix_loc, "UTF-8", true, modifier,
win_locale);
return TRUE;
}