diff options
| author | Paul Eggert | 2018-07-29 09:47:10 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-07-29 09:47:10 -0700 |
| commit | d7052cf393ffd1ab57fd7f7d92abdd00a5b5df8c (patch) | |
| tree | aa2a6123173a7b94c2f6790b610194c796881382 /src | |
| parent | 4e47050df4a61654646bc58cfed79a709c117d2f (diff) | |
| parent | 39d3e8b6bc465df7a9400165a4d813af8af37237 (diff) | |
| download | emacs-d7052cf393ffd1ab57fd7f7d92abdd00a5b5df8c.tar.gz emacs-d7052cf393ffd1ab57fd7f7d92abdd00a5b5df8c.zip | |
Merge from origin/emacs-26
39d3e8b Fix last change in 'char_width'
67679f0 Add initial tests for wdired.el
Diffstat (limited to 'src')
| -rw-r--r-- | src/character.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/character.c b/src/character.c index b17f44b1422..8920da2748f 100644 --- a/src/character.c +++ b/src/character.c | |||
| @@ -289,15 +289,18 @@ char_width (int c, struct Lisp_Char_Table *dp) | |||
| 289 | if (VECTORP (disp)) | 289 | if (VECTORP (disp)) |
| 290 | for (i = 0, width = 0; i < ASIZE (disp); i++) | 290 | for (i = 0, width = 0; i < ASIZE (disp); i++) |
| 291 | { | 291 | { |
| 292 | int c; | 292 | int c = -1; |
| 293 | ch = AREF (disp, i); | 293 | ch = AREF (disp, i); |
| 294 | if (GLYPH_CODE_P (ch)) | 294 | if (GLYPH_CODE_P (ch)) |
| 295 | c = GLYPH_CODE_CHAR (ch); | 295 | c = GLYPH_CODE_CHAR (ch); |
| 296 | else if (CHARACTERP (ch)) | 296 | else if (CHARACTERP (ch)) |
| 297 | c = XFASTINT (ch); | 297 | c = XFASTINT (ch); |
| 298 | int w = CHARACTER_WIDTH (c); | 298 | if (c >= 0) |
| 299 | if (INT_ADD_WRAPV (width, w, &width)) | 299 | { |
| 300 | string_overflow (); | 300 | int w = CHARACTER_WIDTH (c); |
| 301 | if (INT_ADD_WRAPV (width, w, &width)) | ||
| 302 | string_overflow (); | ||
| 303 | } | ||
| 301 | } | 304 | } |
| 302 | } | 305 | } |
| 303 | return width; | 306 | return width; |