public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin/main] Cygwin: locale: fix devanagari modifier
Date: Sun, 26 Feb 2023 16:18:58 +0000 (GMT)	[thread overview]
Message-ID: <20230226161858.8E5FD3858C53@sourceware.org> (raw)

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;

                 reply	other threads:[~2023-02-26 16:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230226161858.8E5FD3858C53@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).