[newlib-cygwin/main] Cygwin: locale: fix devanagari modifier

Corinna Vinschen corinna@sourceware.org
Sun Feb 26 16:18:58 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=abd81bc01fb715768eb00d18124205b72fba35da

commit abd81bc01fb715768eb00d18124205b72fba35da
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Sun Feb 26 17:17:33 2023 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Sun Feb 26 17:17:33 2023 +0100

    Cygwin: locale: fix devanagari modifier
    
    Effectively revert commit 57bac33359db.  The fact that the
    devanagari modifier was called devanagar (missing the trailing 'i')
    is a result of `locale -av' shortening the locale name to a maximum
    of 15 characters.
    
    D'oh.  I guess we need a better way to do this...
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler/proc.cc                                      | 2 +-
 winsup/cygwin/linux-locale-helpers/fetch-lc-def-codesets-from-linux | 2 +-
 winsup/cygwin/local_includes/lc_def_codesets.h                      | 6 +++---
 winsup/cygwin/nlsfuncs.cc                                           | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/winsup/cygwin/fhandler/proc.cc b/winsup/cygwin/fhandler/proc.cc
index 74e5d95011d1..bb32d64986d3 100644
--- a/winsup/cygwin/fhandler/proc.cc
+++ b/winsup/cygwin/fhandler/proc.cc
@@ -2214,7 +2214,7 @@ format_proc_locale_proc (LPWSTR win_locale, DWORD info, LPARAM param)
 	  else if (!wcscmp (iso15924, L"Cyrl;"))
 	    stpcpy (modifier, "@cyrillic");
 	  else if (!wcscmp (iso15924, L"Deva;"))
-	    stpcpy (modifier, "@devanagar");
+	    stpcpy (modifier, "@devanagari");
 	  else if (!wcscmp (iso15924, L"Adlm;"))
 	    stpcpy (modifier, "@adlam");
 	  else
diff --git a/winsup/cygwin/linux-locale-helpers/fetch-lc-def-codesets-from-linux b/winsup/cygwin/linux-locale-helpers/fetch-lc-def-codesets-from-linux
index 1a8afede868a..2a6f6cca2a90 100755
--- a/winsup/cygwin/linux-locale-helpers/fetch-lc-def-codesets-from-linux
+++ b/winsup/cygwin/linux-locale-helpers/fetch-lc-def-codesets-from-linux
@@ -14,7 +14,7 @@
   awk '/^locale:/{
 		   if ( index ($2, "_") == 0 ) next # No aliases
 		   if ( index ($2, ".") > 0 ) next # No explicit codesets
-		   locale=$2;
+		   locale = gensub (/devanagar.*/, "devanagari", 1, $2);
 		 }
        /codeset/ {
 		   if ( length (locale) == 0 ) next
diff --git a/winsup/cygwin/local_includes/lc_def_codesets.h b/winsup/cygwin/local_includes/lc_def_codesets.h
index 9c7230391e40..db7d7f2fb131 100644
--- a/winsup/cygwin/local_includes/lc_def_codesets.h
+++ b/winsup/cygwin/local_includes/lc_def_codesets.h
@@ -1,5 +1,5 @@
 /* This struct of default codesets has been generated by fetching
-   locale data from a Linux system using glibc-2.36-9.fc37.x86_64 on 2023-02-25 */
+   locale data from a Linux system using glibc-2.36-9.fc37.x86_64 on 2023-02-26 */
 struct default_codeset_t
 {
   const char *locale;
@@ -193,7 +193,7 @@ struct default_codeset_t
   { "ko_KR", "EUC-KR" },
   { "kok_IN", "UTF-8" },
   { "ks_IN", "UTF-8" },
-  { "ks_IN@devanagar", "UTF-8" },
+  { "ks_IN@devanagari", "UTF-8" },
   { "ku_TR", "ISO-8859-9" },
   { "kw_GB", "ISO-8859-1" },
   { "ky_KG", "UTF-8" },
@@ -269,7 +269,7 @@ struct default_codeset_t
   { "sat_IN", "UTF-8" },
   { "sc_IT", "UTF-8" },
   { "sd_IN", "UTF-8" },
-  { "sd_IN@devanagar", "UTF-8" },
+  { "sd_IN@devanagari", "UTF-8" },
   { "se_NO", "UTF-8" },
   { "sgs_LT", "UTF-8" },
   { "shn_MM", "UTF-8" },
diff --git a/winsup/cygwin/nlsfuncs.cc b/winsup/cygwin/nlsfuncs.cc
index 8257c23b2f78..dd0fc8dc5f4f 100644
--- a/winsup/cygwin/nlsfuncs.cc
+++ b/winsup/cygwin/nlsfuncs.cc
@@ -126,7 +126,7 @@ __get_rfc5646_from_locale (const char *name, wchar_t *win_locale)
 	idx = 0;
       else if (!strcmp (modifier, "cyrillic"))
 	idx = 1;
-      else if (!strcmp (modifier, "devanagar"))
+      else if (!strcmp (modifier, "devanagari"))
 	idx = 2;
       else if (!strcmp (modifier, "adlam"))
 	idx = 3;


More information about the Cygwin-cvs mailing list