diff src/xfns.c @ 81291:7edf1ae10375

Merge from emacs--rel--22 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-790
author Miles Bader <miles@gnu.org>
date Sat, 09 Jun 2007 03:19:04 +0000
parents 516508c377db 96c01b44f51d
children c567f60cd935 cc587bfd19ca e9f94688a064
line wrap: on
line diff
--- a/src/xfns.c	Sat Jun 09 00:14:06 2007 +0000
+++ b/src/xfns.c	Sat Jun 09 03:19:04 2007 +0000
@@ -1516,6 +1516,8 @@
 /* Encode Lisp string STRING as a text in a format appropriate for
    XICCC (X Inter Client Communication Conventions).
 
+   This can call Lisp code, so callers must GCPRO.
+
    If STRING contains only ASCII characters, do no conversion and
    return the string data of STRING.  Otherwise, encode the text by
    CODING_SYSTEM, and return a newly allocated memory area which
@@ -1563,7 +1565,11 @@
       && SYMBOLP (coding.pre_write_conversion)
       && !NILP (Ffboundp (coding.pre_write_conversion)))
     {
+      struct gcpro gcpro1;
+      /* We don't need to GCPRO string.  */
+      GCPRO1 (coding_system);
       string = run_pre_post_conversion_on_str (string, &coding, 1);
+      UNGCPRO;
       str = SDATA (string);
       chars = SCHARS (string);
       bytes = SBYTES (string);