diff options
author | Glenn Morris <rgm@gnu.org> | 2018-06-18 12:14:25 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2018-06-18 12:14:25 -0700 |
commit | b455a1b2a8b927d3376e30814954a88f611a17c1 (patch) | |
tree | 9a2ebfc3534cb5d0e54124c62abaa7b7075f3536 /src/coding.c | |
parent | 2c335777f78cac0f44df217a48762739533b32db (diff) | |
parent | 63ba73a9f2bdf75363eea678a8c119ed0ffd9799 (diff) | |
download | emacs-b455a1b2a8b927d3376e30814954a88f611a17c1.tar.gz |
Merge from origin/emacs-26
63ba73a Fix documentation of ':propertize' in mode-line-format
22aa665 Reject invalid 5-byte sequences when detecting UTF-8 encoding
0d3c358 Fix 'replace-buffer-contents' in multibyte buffers
c79a627 Update etc/NEWS for mail-source-movemail-program change
63f1dc4 Improve movemail default
0b1a2ae Delete description of deleted Customize functions
fcd66d0 Keep vc-print-log from putting point at buffer end (Bug#31764)
Conflicts:
etc/NEWS
Diffstat (limited to 'src/coding.c')
-rw-r--r-- | src/coding.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c index a16142a9b41..32a9df1c533 100644 --- a/src/coding.c +++ b/src/coding.c @@ -1225,7 +1225,10 @@ detect_coding_utf_8 (struct coding_system *coding, ONE_MORE_BYTE (c4); if (c4 < 0 || ! UTF_8_EXTRA_OCTET_P (c4)) break; - if (UTF_8_5_OCTET_LEADING_P (c)) + if (UTF_8_5_OCTET_LEADING_P (c) + /* If we ever need to increase MAX_CHAR, the below may need + to be reviewed. */ + && c < MAX_MULTIBYTE_LEADING_CODE) { nchars++; continue; |