]> Savannah Git Hosting - gnulib.git/commitdiff
localeinfo: case_folded_counterparts and WEOF
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 16 Jan 2017 05:23:34 +0000 (21:23 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 16 Jan 2017 05:25:06 +0000 (21:25 -0800)
* NEWS: Document this.
* lib/localeinfo.c (case_folded_counterparts):
First arg is now wint_t, not wchar_t.  This generalizes the
function to also work on WEOF, where it returns 0.

ChangeLog
NEWS
lib/localeinfo.c
lib/localeinfo.h

index e0b836bcff194adc9f85567a1032fc2cb19d8417..31770bf7befdeba495b592c63a80892a38241f8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2017-01-15  Paul Eggert  <eggert@cs.ucla.edu>
 
+       localeinfo: case_folded_counterparts and WEOF
+       * NEWS: Document this.
+       * lib/localeinfo.c (case_folded_counterparts):
+       First arg is now wint_t, not wchar_t.  This generalizes the
+       function to also work on WEOF, where it returns 0.
+
        dfa: port to gcc -fsanitize=undefined
        * lib/dfa.c (copy): Don’t pass NULL with size 0 to memcpy,
        as this runs afoul of gcc -fsanitize=undefined.
diff --git a/NEWS b/NEWS
index 3db60850552e68af8b2b9a96adad362b630a043b..791bcafed6b14fbcce1018a3b35ba1ad89fecc82 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,9 @@ User visible incompatible changes
 
 Date        Modules         Changes
 
+2017-01-15  localeinfo      Change case_folded_counterparts's first arg's type
+                            from wchar_t to wint_t, so it now accepts WEOF.
+
 2016-12-17  getlogin        The link requirements of these modules are changed
             getlogin_r      from empty to $(LIB_GETLOGIN).
 
index 36dabf4955c5fc04f3a76c70c02b7973c668175d..ece679e3bf621a519da54ed6926e6cc3831fab22 100644 (file)
@@ -90,10 +90,10 @@ verify (1 + 1 + sizeof lonesome_lower / sizeof *lonesome_lower
 
 /* Find the characters equal to C after case-folding, other than C
    itself, and store them into FOLDED.  Return the number of characters
-   stored.  */
+   stored; this is zero if C is WEOF.  */
 
 int
-case_folded_counterparts (wchar_t c, wchar_t folded[CASE_FOLDED_BUFSIZE])
+case_folded_counterparts (wint_t c, wchar_t folded[CASE_FOLDED_BUFSIZE])
 {
   int i;
   int n = 0;
index 3b4f0d2247ea1d47b082ba9bbb7aabfb5cf145d8..a6773f52d8b162fd9a2360609c7cd1c9b7698863 100644 (file)
@@ -51,4 +51,4 @@ extern void init_localeinfo (struct localeinfo *);
    itself.  This is a generous upper bound.  */
 enum { CASE_FOLDED_BUFSIZE = 32 };
 
-extern int case_folded_counterparts (wchar_t, wchar_t[CASE_FOLDED_BUFSIZE]);
+extern int case_folded_counterparts (wint_t, wchar_t[CASE_FOLDED_BUFSIZE]);