comparison src/mule-coding.c @ 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 3ba90c659d01
children 0c54de4c4b9d
comparison
equal deleted inserted replaced
4702:eb1a409c317b 4703:6dfca4f26f53
3536 { 3536 {
3537 struct ccl_program test_ccl; 3537 struct ccl_program test_ccl;
3538 3538
3539 if (EQ (key, Qdecode) || EQ (key, Qencode)) 3539 if (EQ (key, Qdecode) || EQ (key, Qencode))
3540 { 3540 {
3541 Lisp_Object sym;
3542
3543 CHECK_VECTOR (value);
3544
3545 sym = Fintern (concat3 (XSYMBOL_NAME (XCODING_SYSTEM_NAME (codesys)),
3546 build_string ("-"),
3547 XSYMBOL_NAME (key)), Qnil);
3548
3549 Fregister_ccl_program (sym, value);
3550
3551
3541 /* Check if the CCL infrastructure thinks this is a sane CCL 3552 /* Check if the CCL infrastructure thinks this is a sane CCL
3542 program: */ 3553 program: */
3543 if (setup_ccl_program (&test_ccl, value) < 0) 3554 if (setup_ccl_program (&test_ccl, value) < 0)
3544 { 3555 {
3545 invalid_argument ("Invalid CCL program", value); 3556 invalid_argument ("Invalid CCL program", value);
3546 } 3557 }
3547 3558
3548 if (EQ (key, Qdecode)) 3559 if (EQ (key, Qdecode))
3549 { 3560 {
3550 XCODING_SYSTEM_FIXED_WIDTH_DECODE (codesys) = value; 3561 XCODING_SYSTEM_FIXED_WIDTH_DECODE (codesys) = sym;
3551 } 3562 }
3552 else 3563 else
3553 { 3564 {
3554 XCODING_SYSTEM_FIXED_WIDTH_ENCODE (codesys) = value; 3565 XCODING_SYSTEM_FIXED_WIDTH_ENCODE (codesys) = sym;
3555 } 3566 }
3556 } 3567 }
3557 else if (EQ (key, Qfrom_unicode)) 3568 else if (EQ (key, Qfrom_unicode))
3558 { 3569 {
3559 CHECK_HASH_TABLE (value); 3570 CHECK_HASH_TABLE (value);