changeset 4703:6dfca4f26f53

Register any CCL programs used by fixed-width coding-systems. src/ChangeLog addition: 2009-09-30 Aidan Kehoe <kehoea@parhasard.net> * mule-coding.c (fixed_width_putprop): Register any CCL programs, avoiding crashes described by Robert Delius Royar. Though it's unclear why, I'll try to investigate once I'm on a 32-bit Unix machine regularly again.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 30 Sep 2009 12:48:21 +0100
parents eb1a409c317b
children 44c9d1005ce2
files src/ChangeLog src/mule-coding.c
diffstat 2 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Sep 28 18:04:07 2009 +0200
+++ b/src/ChangeLog	Wed Sep 30 12:48:21 2009 +0100
@@ -1,3 +1,10 @@
+2009-09-30  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* mule-coding.c (fixed_width_putprop): 
+	Register any CCL programs, avoiding crashes described by Robert
+	Delius Royar. Though it's unclear why, I'll try to investigate
+	once I'm on a 32-bit Unix machine regularly again.
+
 2009-09-23  Stephen Turnbull  <stephen@xemacs.org>
 
 	* glyphs-eimage.c (png_instantiate):
--- a/src/mule-coding.c	Mon Sep 28 18:04:07 2009 +0200
+++ b/src/mule-coding.c	Wed Sep 30 12:48:21 2009 +0100
@@ -3538,6 +3538,17 @@
 
   if (EQ (key, Qdecode) || EQ (key, Qencode))
     {
+      Lisp_Object sym;
+
+      CHECK_VECTOR (value);
+
+      sym = Fintern (concat3 (XSYMBOL_NAME (XCODING_SYSTEM_NAME (codesys)),
+                              build_string ("-"),
+                              XSYMBOL_NAME (key)), Qnil);
+
+      Fregister_ccl_program (sym, value);
+
+      
       /* Check if the CCL infrastructure thinks this is a sane CCL
          program: */
       if (setup_ccl_program (&test_ccl, value) < 0)
@@ -3547,11 +3558,11 @@
 
       if (EQ (key, Qdecode))
         {
-          XCODING_SYSTEM_FIXED_WIDTH_DECODE (codesys) = value;
+          XCODING_SYSTEM_FIXED_WIDTH_DECODE (codesys) = sym;
         }
       else 
         {
-          XCODING_SYSTEM_FIXED_WIDTH_ENCODE (codesys) = value;
+          XCODING_SYSTEM_FIXED_WIDTH_ENCODE (codesys) = sym;
         }
     }
   else if (EQ (key, Qfrom_unicode))