aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKaroly Lorentey2004-06-07 08:00:27 +0000
committerKaroly Lorentey2004-06-07 08:00:27 +0000
commit620c7a273359e1b13adee5896933ce9fa122c860 (patch)
tree8f521c5cec6811ff47163f3bbd96e2eb02020658 /src/coding.c
parentc98e2d50e4f0f0eaf69520092cb94531545b221d (diff)
parenta0a2334679b7278ca0577a733c8ba8d0362a1a38 (diff)
downloademacs-620c7a273359e1b13adee5896933ce9fa122c860.tar.gz
emacs-620c7a273359e1b13adee5896933ce9fa122c860.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-376 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-377 (Fdisplay_supports_face_attributes_p): Work around bootstrapping problem * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-378 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-379 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-380 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-381 Face merging cleanups git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-190
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/coding.c b/src/coding.c
index 7e90b985143..328507de499 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6566,8 +6566,8 @@ highest priority. */)
6566 possible coding systems. If it is nil, it means that we have not 6566 possible coding systems. If it is nil, it means that we have not
6567 yet found any coding systems. 6567 yet found any coding systems.
6568 6568
6569 WORK_TABLE is a copy of the char-table Vchar_coding_system_table. An 6569 WORK_TABLE a char-table of which element is set to t once the
6570 element of WORK_TABLE is set to t once the element is looked up. 6570 element is looked up.
6571 6571
6572 If a non-ASCII single byte char is found, set 6572 If a non-ASCII single byte char is found, set
6573 *single_byte_char_found to 1. */ 6573 *single_byte_char_found to 1. */
@@ -6582,6 +6582,8 @@ find_safe_codings (p, pend, safe_codings, work_table, single_byte_char_found)
6582 Lisp_Object val, ch; 6582 Lisp_Object val, ch;
6583 Lisp_Object prev, tail; 6583 Lisp_Object prev, tail;
6584 6584
6585 if (NILP (safe_codings))
6586 goto done_safe_codings;
6585 while (p < pend) 6587 while (p < pend)
6586 { 6588 {
6587 c = STRING_CHAR_AND_LENGTH (p, pend - p, len); 6589 c = STRING_CHAR_AND_LENGTH (p, pend - p, len);
@@ -6591,11 +6593,6 @@ find_safe_codings (p, pend, safe_codings, work_table, single_byte_char_found)
6591 continue; 6593 continue;
6592 if (SINGLE_BYTE_CHAR_P (c)) 6594 if (SINGLE_BYTE_CHAR_P (c))
6593 *single_byte_char_found = 1; 6595 *single_byte_char_found = 1;
6594 if (NILP (safe_codings))
6595 /* Already all coding systems are excluded. But, we can't
6596 terminate the loop here because non-ASCII single-byte char
6597 must be found. */
6598 continue;
6599 /* Check the safe coding systems for C. */ 6596 /* Check the safe coding systems for C. */
6600 ch = make_number (c); 6597 ch = make_number (c);
6601 val = Faref (work_table, ch); 6598 val = Faref (work_table, ch);
@@ -6673,12 +6670,33 @@ find_safe_codings (p, pend, safe_codings, work_table, single_byte_char_found)
6673 { 6670 {
6674 /* Exclude this coding system from SAFE_CODINGS. */ 6671 /* Exclude this coding system from SAFE_CODINGS. */
6675 if (EQ (tail, safe_codings)) 6672 if (EQ (tail, safe_codings))
6676 safe_codings = XCDR (safe_codings); 6673 {
6674 safe_codings = XCDR (safe_codings);
6675 if (NILP (safe_codings))
6676 goto done_safe_codings;
6677 }
6677 else 6678 else
6678 XSETCDR (prev, XCDR (tail)); 6679 XSETCDR (prev, XCDR (tail));
6679 } 6680 }
6680 } 6681 }
6681 } 6682 }
6683
6684 done_safe_codings:
6685 /* If the above loop was terminated before P reaches PEND, it means
6686 SAFE_CODINGS was set to nil. If we have not yet found an
6687 non-ASCII single-byte char, check it now. */
6688 if (! *single_byte_char_found)
6689 while (p < pend)
6690 {
6691 c = STRING_CHAR_AND_LENGTH (p, pend - p, len);
6692 p += len;
6693 if (! ASCII_BYTE_P (c)
6694 && SINGLE_BYTE_CHAR_P (c))
6695 {
6696 *single_byte_char_found = 1;
6697 break;
6698 }
6699 }
6682 return safe_codings; 6700 return safe_codings;
6683} 6701}
6684 6702