emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 58a44b6ac31 2/3: Fix misuse of toupper in sfnt_parse_style


From: Paul Eggert
Subject: master 58a44b6ac31 2/3: Fix misuse of toupper in sfnt_parse_style
Date: Tue, 17 Sep 2024 19:39:56 -0400 (EDT)

branch: master
commit 58a44b6ac317c9a17bcdd208e4ec33ff9772429e
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    Fix misuse of toupper in sfnt_parse_style
    
    * src/sfntfont.c: Include c-ctype.h, not ctype.h.
    (sfnt_parse_style): Upcase just initial ASCII letters;
    that’s good enough here.
---
 src/sfntfont.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/sfntfont.c b/src/sfntfont.c
index 8c02c05e7a6..f21b6c0782f 100644
--- a/src/sfntfont.c
+++ b/src/sfntfont.c
@@ -20,7 +20,7 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include <config.h>
 
 #include <fcntl.h>
-#include <ctype.h>
+#include <c-ctype.h>
 
 #include "lisp.h"
 
@@ -534,12 +534,12 @@ sfnt_parse_style (Lisp_Object style_name, struct 
sfnt_font_desc *desc)
        }
 
       /* This token is extraneous or was not recognized.  Capitalize
-        the first letter and set it as the adstyle.  */
+        the first letter if it's ASCII lowercase, then set the token as
+        the adstyle.  */
 
       if (strlen (single))
        {
-         if (islower (single[0]))
-           single[0] = toupper (single[0]);
+         single[0] = c_toupper (single[0]);
 
          if (NILP (desc->adstyle))
            desc->adstyle = build_string (single);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]