* search.c (Freplace_match): Use make_specified_string.
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 31 Mar 2014 07:13:58 +0000 (11:13 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Mon, 31 Mar 2014 07:13:58 +0000 (11:13 +0400)
* xterm.c, w32term.c (x_set_glyph_string_gc): Use emacs_abort
to catch bogus override face of glyph strings.

src/ChangeLog
src/search.c
src/w32term.c
src/xterm.c

index 92be5b0..ea34def 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-31  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * search.c (Freplace_match): Use make_specified_string.
+       * xterm.c, w32term.c (x_set_glyph_string_gc): Use emacs_abort
+       to catch bogus override face of glyph strings.
+
 2014-03-31  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsmenu.m (free_frame_tool_bar): Set wait_for_tool_bar = NO (Bug#16976)
index 3de194c..9bec825 100644 (file)
@@ -2679,18 +2679,8 @@ since only regular expressions have distinguished subexpressions.  */)
        }
 
       if (really_changed)
-       {
-         if (buf_multibyte)
-           {
-             ptrdiff_t nchars =
-               multibyte_chars_in_text (substed, substed_len);
-
-             newtext = make_multibyte_string ((char *) substed, nchars,
-                                              substed_len);
-           }
-         else
-           newtext = make_unibyte_string ((char *) substed, substed_len);
-       }
+       newtext = make_specified_string ((const char *) substed, -1,
+                                        substed_len, buf_multibyte);
       xfree (substed);
     }
 
index 256d750..40c1e59 100644 (file)
@@ -1078,10 +1078,7 @@ x_set_glyph_string_gc (struct glyph_string *s)
       s->stippled_p = s->face->stipple != 0;
     }
   else
-    {
-      s->gc = s->face->gc;
-      s->stippled_p = s->face->stipple != 0;
-    }
+    emacs_abort ();
 
   /* GC must have been set.  */
   eassert (s->gc != 0);
index 31e1b9c..1c0aea0 100644 (file)
@@ -968,10 +968,7 @@ x_set_glyph_string_gc (struct glyph_string *s)
       s->stippled_p = s->face->stipple != 0;
     }
   else
-    {
-      s->gc = s->face->gc;
-      s->stippled_p = s->face->stipple != 0;
-    }
+    emacs_abort ();
 
   /* GC must have been set.  */
   eassert (s->gc != 0);