]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid uninitialized variable warning
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Tue, 27 Sep 2022 03:39:31 +0000 (12:39 +0900)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Tue, 27 Sep 2022 03:39:31 +0000 (12:39 +0900)
* src/composite.c (composition_gstring_adjust_zero_width): Simplify
last change with respect to an exit condition.

src/composite.c

index 0417bc866d488fd0f52c8097a9cd5dbf389eec9a..6b256171ac7d55b03a12d7ed7727f3600ff65460 100644 (file)
@@ -815,9 +815,12 @@ composition_gstring_adjust_zero_width (Lisp_Object gstring)
     {
       Lisp_Object glyph;
 
-      if (i == LGSTRING_GLYPH_LEN (gstring)
-         || (glyph = LGSTRING_GLYPH (gstring, i),
-             (NILP (glyph) || from != LGLYPH_FROM (glyph))))
+      if (i < LGSTRING_GLYPH_LEN (gstring))
+       glyph = LGSTRING_GLYPH (gstring, i);
+      else
+       glyph = Qnil;
+
+      if (NILP (glyph) || from != LGLYPH_FROM (glyph))
        {
          eassert (i > 0);
          Lisp_Object last = LGSTRING_GLYPH (gstring, i - 1);
@@ -834,7 +837,7 @@ composition_gstring_adjust_zero_width (Lisp_Object gstring)
                ASET (LGLYPH_ADJUSTMENT (last), 2,
                      make_fixnum (LGLYPH_WADJUST (last) + 1));
            }
-         if (i == LGSTRING_GLYPH_LEN (gstring) || NILP (glyph))
+         if (NILP (glyph))
            break;
          from = LGLYPH_FROM (glyph);
          width = 0;