diff options
| author | Kenichi Handa | 2002-07-22 12:28:14 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-07-22 12:28:14 +0000 |
| commit | 970b7474fdab337fc60d2db09fc18b125a5b0e6c (patch) | |
| tree | 28525d5f9f727e6638420074e950726524a91f48 | |
| parent | 95d6ca40462ee6f0d610375f7dcca25cd31e17cb (diff) | |
| download | emacs-970b7474fdab337fc60d2db09fc18b125a5b0e6c.tar.gz emacs-970b7474fdab337fc60d2db09fc18b125a5b0e6c.zip | |
(Fmap_charset_chars): Fix handling of default value for FROM_CODE
and TO_CODE.
| -rw-r--r-- | src/charset.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/charset.c b/src/charset.c index c4ec97b2a65..d698f76017d 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -670,18 +670,23 @@ range of code points of targer characters. */) | |||
| 670 | 670 | ||
| 671 | CHECK_CHARSET_GET_CHARSET (charset, cs); | 671 | CHECK_CHARSET_GET_CHARSET (charset, cs); |
| 672 | if (NILP (from_code)) | 672 | if (NILP (from_code)) |
| 673 | from_code = make_number (0); | ||
| 674 | CHECK_NATNUM (from_code); | ||
| 675 | from = XINT (from_code); | ||
| 676 | if (from < CHARSET_MIN_CODE (cs)) | ||
| 677 | from = CHARSET_MIN_CODE (cs); | 673 | from = CHARSET_MIN_CODE (cs); |
| 674 | else | ||
| 675 | { | ||
| 676 | CHECK_NATNUM (from_code); | ||
| 677 | from = XINT (from_code); | ||
| 678 | if (from < CHARSET_MIN_CODE (cs)) | ||
| 679 | from = CHARSET_MIN_CODE (cs); | ||
| 680 | } | ||
| 678 | if (NILP (to_code)) | 681 | if (NILP (to_code)) |
| 679 | to_code = make_number (0xFFFFFFFF); | 682 | to = CHARSET_MAX_CODE (cs); |
| 680 | CHECK_NATNUM (from_code); | 683 | else |
| 681 | to = XINT (to_code); | 684 | { |
| 682 | if (to > CHARSET_MAX_CODE (cs)) | 685 | CHECK_NATNUM (to_code); |
| 683 | to_code = make_number (CHARSET_MAX_CODE (cs)); | 686 | to = XINT (to_code); |
| 684 | 687 | if (to > CHARSET_MAX_CODE (cs)) | |
| 688 | to = CHARSET_MAX_CODE (cs); | ||
| 689 | } | ||
| 685 | map_charset_chars (NULL, function, arg, cs, from, to); | 690 | map_charset_chars (NULL, function, arg, cs, from, to); |
| 686 | return Qnil; | 691 | return Qnil; |
| 687 | } | 692 | } |