diff options
| author | Eli Zaretskii | 2021-05-27 17:15:53 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2021-05-27 17:15:53 +0300 |
| commit | f1c3b82d401eecd1facbe0a6c07ccde100ad65d8 (patch) | |
| tree | 4774298d23926994beae24f84ec026260c39b368 /src | |
| parent | 0d0e6143e75b1f1fb5c366c2181b6f8196abec0e (diff) | |
| download | emacs-f1c3b82d401eecd1facbe0a6c07ccde100ad65d8.tar.gz emacs-f1c3b82d401eecd1facbe0a6c07ccde100ad65d8.zip | |
; * src/character.c (lisp_string_width): Another defensive fix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/character.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/character.c b/src/character.c index e72fdc0c4bd..60424fab71e 100644 --- a/src/character.c +++ b/src/character.c | |||
| @@ -394,9 +394,12 @@ lisp_string_width (Lisp_Object string, ptrdiff_t from, ptrdiff_t to, | |||
| 394 | SBYTES (default_font)))) | 394 | SBYTES (default_font)))) |
| 395 | { | 395 | { |
| 396 | Lisp_Object font_info = Ffont_info (default_font, Qnil); | 396 | Lisp_Object font_info = Ffont_info (default_font, Qnil); |
| 397 | font_width = XFIXNUM (AREF (font_info, 11)); | 397 | if (VECTORP (font_info)) |
| 398 | if (font_width <= 0) | 398 | { |
| 399 | font_width = XFIXNUM (AREF (font_info, 10)); | 399 | font_width = XFIXNUM (AREF (font_info, 11)); |
| 400 | if (font_width <= 0) | ||
| 401 | font_width = XFIXNUM (AREF (font_info, 10)); | ||
| 402 | } | ||
| 400 | } | 403 | } |
| 401 | } | 404 | } |
| 402 | thiswidth = (double) pixelwidth / font_width + 0.5; | 405 | thiswidth = (double) pixelwidth / font_width + 0.5; |