aboutsummaryrefslogtreecommitdiffstats
path: root/src/character.c
diff options
context:
space:
mode:
authorTom Tromey2018-08-09 17:56:53 -0600
committerTom Tromey2018-08-09 17:56:53 -0600
commitaccb7b7ecc19f85c2750ded1046a464bc73c6a52 (patch)
tree1aa94af022d6700a93a8ff2b73f5b210046ac010 /src/character.c
parentf822a2516d88eeb2118fbbc8554f155e86dfd74e (diff)
parent53483df0de0085dbc9ef0b15a0f629ab808b0147 (diff)
downloademacs-accb7b7ecc19f85c2750ded1046a464bc73c6a52.tar.gz
emacs-accb7b7ecc19f85c2750ded1046a464bc73c6a52.zip
Merge remote-tracking branch 'origin/master' into feature/bignum
Diffstat (limited to 'src/character.c')
-rw-r--r--src/character.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/character.c b/src/character.c
index 97698d77890..851e61e778f 100644
--- a/src/character.c
+++ b/src/character.c
@@ -34,6 +34,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
34#include "lisp.h" 34#include "lisp.h"
35#include "character.h" 35#include "character.h"
36#include "buffer.h" 36#include "buffer.h"
37#include "dispextern.h"
37#include "composite.h" 38#include "composite.h"
38#include "disptab.h" 39#include "disptab.h"
39 40
@@ -288,10 +289,15 @@ char_width (int c, struct Lisp_Char_Table *dp)
288 if (VECTORP (disp)) 289 if (VECTORP (disp))
289 for (i = 0, width = 0; i < ASIZE (disp); i++) 290 for (i = 0, width = 0; i < ASIZE (disp); i++)
290 { 291 {
292 int c = -1;
291 ch = AREF (disp, i); 293 ch = AREF (disp, i);
292 if (CHARACTERP (ch)) 294 if (GLYPH_CODE_P (ch))
295 c = GLYPH_CODE_CHAR (ch);
296 else if (CHARACTERP (ch))
297 c = XFASTINT (ch);
298 if (c >= 0)
293 { 299 {
294 int w = CHARACTER_WIDTH (XFIXNAT (ch)); 300 int w = CHARACTER_WIDTH (c);
295 if (INT_ADD_WRAPV (width, w, &width)) 301 if (INT_ADD_WRAPV (width, w, &width))
296 string_overflow (); 302 string_overflow ();
297 } 303 }