emacs-diffs
[Top][All Lists]
Advanced

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

emacs-30 c25687e860f: Fix various typos reported by Pip Cet


From: Po Lu
Subject: emacs-30 c25687e860f: Fix various typos reported by Pip Cet
Date: Sat, 3 Aug 2024 05:09:58 -0400 (EDT)

branch: emacs-30
commit c25687e860fbae6178afe8096ec003f5f4ce6462
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix various typos reported by Pip Cet
    
    * src/ftfont.c (get_adstyle_property):
    
    * src/sfntfont.c (sfntfont_list_1): Correct typos.  Reported by
    Pip Cet <pipcet@protonmail.com>.
---
 src/ftfont.c   | 10 +++++-----
 src/sfntfont.c | 17 ++++++++++-------
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/ftfont.c b/src/ftfont.c
index c89feea1d46..882d3eec256 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -174,11 +174,11 @@ get_adstyle_property (FcPattern *p)
   USE_SAFE_ALLOCA;
   tmp = SAFE_ALLOCA (end - str);
   for (i = 0; i < end - str; ++i)
-    tmp[i] = ((end[i] != '?'
-              && end[i] != '*'
-              && end[i] != '"'
-              && end[i] != '-')
-             ? end[i] : ' ');
+    tmp[i] = ((str[i] != '?'
+              && str[i] != '*'
+              && str[i] != '"'
+              && str[i] != '-')
+             ? str[i] : ' ');
   adstyle = font_intern_prop (tmp, end - str, 1);
   SAFE_FREE ();
   if (font_style_to_value (FONT_WIDTH_INDEX, adstyle, 0) >= 0)
diff --git a/src/sfntfont.c b/src/sfntfont.c
index d1376939a3c..8c02c05e7a6 100644
--- a/src/sfntfont.c
+++ b/src/sfntfont.c
@@ -1643,6 +1643,7 @@ sfntfont_list_1 (struct sfnt_font_desc *desc, Lisp_Object 
spec,
   struct sfnt_cmap_encoding_subtable subtable;
   int instance, num_instance;
   Lisp_Object item;
+  bool matching;
 
   /* cmap and subtable are caches for sfntfont_lookup_char.  */
 
@@ -1788,19 +1789,21 @@ sfntfont_list_1 (struct sfnt_font_desc *desc, 
Lisp_Object spec,
 
          /* The vector contains characters, of which one must be
             present in the font.  */
+         matching = false;
          for (i = 0; i < ASIZE (tem); ++i)
            {
              if (FIXNUMP (AREF (tem, i)))
                {
-                 if (!sfntfont_lookup_char (desc, AREF (tem, i),
-                                            &cmap, &subtable))
-                   goto fail;
-
-                 /* One character is enough to pass a font.  Don't
-                    look at too many.  */
-                 break;
+                 if (sfntfont_lookup_char (desc, AREF (tem, i),
+                                           &cmap, &subtable))
+                   {
+                     matching = true;
+                     break;
+                   }
                }
            }
+         if (!matching)
+           goto fail;
        }
       else if (CONSP (tem) && CONSP (XCDR (tem)))
        {



reply via email to

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