diff options
| author | Eli Zaretskii | 2016-01-15 17:36:47 +0200 |
|---|---|---|
| committer | Paul Eggert | 2016-03-21 17:05:55 -0700 |
| commit | a17bddeaa430715bf98f662a2c24ae5af50cc6b8 (patch) | |
| tree | 3a28c7ca9d8e62c8e7ce46d53ff865b1231757af /src | |
| parent | 5a78876770255ee5e4f2dd0e9b5de30389b195da (diff) | |
| download | emacs-a17bddeaa430715bf98f662a2c24ae5af50cc6b8.tar.gz emacs-a17bddeaa430715bf98f662a2c24ae5af50cc6b8.zip | |
Ensure positive number of glyphs for margins of positive width
* src/dispnew.c (margin_glyphs_to_reserve): Always return a
positive value when a non-zero width of the marginal area was
requested. (Bug#22356)
[This reapplies commit 740849fe986b62a839bce4bbf67d0036fc1be0b9,
which was inadvertently lost by merge commit
7823745acbe9b87eea2db4ef434e379fc903ec35.]
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 9cf12f1a995..3a0532a693b 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -321,7 +321,9 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, int margin) | |||
| 321 | int width = w->total_cols; | 321 | int width = w->total_cols; |
| 322 | double d = max (0, margin); | 322 | double d = max (0, margin); |
| 323 | d = min (width / 2 - 1, d); | 323 | d = min (width / 2 - 1, d); |
| 324 | return (int) ((double) total_glyphs / width * d); | 324 | /* Since MARGIN is positive, we cannot possibly have less than |
| 325 | one glyph for the marginal area. */ | ||
| 326 | return max (1, (int) ((double) total_glyphs / width * d)); | ||
| 325 | } | 327 | } |
| 326 | return 0; | 328 | return 0; |
| 327 | } | 329 | } |