diff options
| author | Po Lu | 2024-06-26 12:13:52 +0800 |
|---|---|---|
| committer | Po Lu | 2024-06-26 12:13:52 +0800 |
| commit | f8399633b4cc17b79ceee4ba3bd0f36fc3c0b3d9 (patch) | |
| tree | 72cbd1eb21f524f6d7ccf5bccd10a0163e3a93eb /src | |
| parent | 4ce30903c5dea2195b80118e2633eedd9322ce49 (diff) | |
| parent | 8b1841021c0d1ca92cb79443909824519429f75f (diff) | |
| download | emacs-f8399633b4cc17b79ceee4ba3bd0f36fc3c0b3d9.tar.gz emacs-f8399633b4cc17b79ceee4ba3bd0f36fc3c0b3d9.zip | |
Merge from savannah/emacs-30
8b1841021c0 Avert crash in store_mode_line_string on Android 5.0 and ...
e7c85f9235a Use HarfBuzz in Cygwin-w32 build
8e3e206bd32 ; * src/buffer.c (syms_of_buffer) <mode-line-format>: ASC...
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 2 | ||||
| -rw-r--r-- | src/w32uniscribe.c | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 13 |
3 files changed, 19 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c index 8f983692124..744b0ef5548 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5183,7 +5183,7 @@ A string is printed verbatim in the mode line except for %-constructs: | |||
| 5183 | %P -- print percent of buffer above bottom of window, perhaps plus Top, | 5183 | %P -- print percent of buffer above bottom of window, perhaps plus Top, |
| 5184 | or print Bottom or All. | 5184 | or print Bottom or All. |
| 5185 | %q -- print percent of buffer above both the top and the bottom of the | 5185 | %q -- print percent of buffer above both the top and the bottom of the |
| 5186 | window, separated by ‘-’, or ‘All’. | 5186 | window, separated by `-', or `All'. |
| 5187 | %s -- print process status. | 5187 | %s -- print process status. |
| 5188 | %z -- print mnemonics of keyboard, terminal, and buffer coding systems. | 5188 | %z -- print mnemonics of keyboard, terminal, and buffer coding systems. |
| 5189 | %Z -- like %z, but including the end-of-line format. | 5189 | %Z -- like %z, but including the end-of-line format. |
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index b3112912c76..dacd6dd766e 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c | |||
| @@ -1527,12 +1527,17 @@ syms_of_w32uniscribe_for_pdumper (void) | |||
| 1527 | uniscribe_new_apis = false; | 1527 | uniscribe_new_apis = false; |
| 1528 | 1528 | ||
| 1529 | #ifdef HAVE_HARFBUZZ | 1529 | #ifdef HAVE_HARFBUZZ |
| 1530 | /* Currently, HarfBuzz DLLs are always named libharfbuzz-0.dll, as | 1530 | /* Currently, HarfBuzz DLLs are always named libharfbuzz-0.dll on |
| 1531 | MS-Windows and cygharfbuzz-0.dll on Cygwin, as | ||
| 1531 | the project keeps the ABI backward-compatible. So we can | 1532 | the project keeps the ABI backward-compatible. So we can |
| 1532 | hard-code the name of the library here, for now. If they ever | 1533 | hard-code the name of the library here, for now. If they ever |
| 1533 | break ABI compatibility, we may need to load the DLL that | 1534 | break ABI compatibility, we may need to load the DLL that |
| 1534 | corresponds to the HarfBuzz version for which Emacs was built. */ | 1535 | corresponds to the HarfBuzz version for which Emacs was built. */ |
| 1536 | # ifdef WINDOWSNT | ||
| 1535 | HMODULE harfbuzz = LoadLibrary ("libharfbuzz-0.dll"); | 1537 | HMODULE harfbuzz = LoadLibrary ("libharfbuzz-0.dll"); |
| 1538 | # else /* CYGWIN */ | ||
| 1539 | HMODULE harfbuzz = LoadLibrary ("cygharfbuzz-0.dll"); | ||
| 1540 | # endif /* CYGWIN */ | ||
| 1536 | /* Don't register if HarfBuzz is not available. */ | 1541 | /* Don't register if HarfBuzz is not available. */ |
| 1537 | if (!harfbuzz) | 1542 | if (!harfbuzz) |
| 1538 | return; | 1543 | return; |
diff --git a/src/xdisp.c b/src/xdisp.c index 8c7e8e5cb43..566c4b211d6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -28065,7 +28065,18 @@ store_mode_line_string (const char *string, Lisp_Object lisp_string, | |||
| 28065 | 28065 | ||
| 28066 | if (string != NULL) | 28066 | if (string != NULL) |
| 28067 | { | 28067 | { |
| 28068 | len = strnlen (string, precision <= 0 ? SIZE_MAX : precision); | 28068 | #if defined HAVE_ANDROID && !defined ANDROID_STUBIFY \ |
| 28069 | && __ANDROID_API__ < 22 | ||
| 28070 | /* Circumvent a bug in memchr preventing strnlen from returning | ||
| 28071 | valid values when a large limit is specified. | ||
| 28072 | |||
| 28073 | https://issuetracker.google.com/issues/37020957 */ | ||
| 28074 | if (precision <= 0 || ((uintptr_t) string | ||
| 28075 | > (UINTPTR_MAX - precision))) | ||
| 28076 | len = strlen (string); | ||
| 28077 | else | ||
| 28078 | #endif /* HAVE_ANDROID && !ANDROID_STUBIFY && __ANDROID_API__ < 22 */ | ||
| 28079 | len = strnlen (string, precision <= 0 ? SIZE_MAX : precision); | ||
| 28069 | lisp_string = make_string (string, len); | 28080 | lisp_string = make_string (string, len); |
| 28070 | if (NILP (props)) | 28081 | if (NILP (props)) |
| 28071 | props = mode_line_string_face_prop; | 28082 | props = mode_line_string_face_prop; |