diff options
| author | Paul Eggert | 2011-07-28 16:47:01 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-28 16:47:01 -0700 |
| commit | 483a9e21b6c8387cdbd5a5f3ab8a3fe77f7e52a0 (patch) | |
| tree | e372226d8df85b9ce9eaa3a0d9b0111138ea9c4b /src | |
| parent | 2f645268752fbbaf6f094dab704fce2c667f7468 (diff) | |
| download | emacs-483a9e21b6c8387cdbd5a5f3ab8a3fe77f7e52a0.tar.gz emacs-483a9e21b6c8387cdbd5a5f3ab8a3fe77f7e52a0.zip | |
* fringe.c (Fdefine_fringe_bitmap): Don't update size until alloc works.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/fringe.c | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e2b613d03c8..058c250a330 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2011-07-28 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-07-28 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * fringe.c (Fdefine_fringe_bitmap): Don't update size until alloc works. | ||
| 4 | |||
| 3 | * frame.h (struct frame): Use int, not EMACS_INT, where int works. | 5 | * frame.h (struct frame): Use int, not EMACS_INT, where int works. |
| 4 | This is for the members text_lines, text_cols, total_lines, total_cols, | 6 | This is for the members text_lines, text_cols, total_lines, total_cols, |
| 5 | where the system imposes an 'int' limit. | 7 | where the system imposes an 'int' limit. |
diff --git a/src/fringe.c b/src/fringe.c index a4dc9433aff..5878c541247 100644 --- a/src/fringe.c +++ b/src/fringe.c | |||
| @@ -1610,22 +1610,25 @@ If BITMAP already exists, the existing definition is replaced. */) | |||
| 1610 | 1610 | ||
| 1611 | if (n == max_fringe_bitmaps) | 1611 | if (n == max_fringe_bitmaps) |
| 1612 | { | 1612 | { |
| 1613 | if ((max_fringe_bitmaps + 20) > MAX_FRINGE_BITMAPS) | 1613 | int bitmaps = max_fringe_bitmaps + 20; |
| 1614 | if (MAX_FRINGE_BITMAPS < bitmaps) | ||
| 1614 | error ("No free fringe bitmap slots"); | 1615 | error ("No free fringe bitmap slots"); |
| 1615 | 1616 | ||
| 1616 | i = max_fringe_bitmaps; | 1617 | i = max_fringe_bitmaps; |
| 1617 | max_fringe_bitmaps += 20; | ||
| 1618 | fringe_bitmaps | 1618 | fringe_bitmaps |
| 1619 | = ((struct fringe_bitmap **) | 1619 | = ((struct fringe_bitmap **) |
| 1620 | xrealloc (fringe_bitmaps, max_fringe_bitmaps * sizeof (struct fringe_bitmap *))); | 1620 | xrealloc (fringe_bitmaps, bitmaps * sizeof *fringe_bitmaps)); |
| 1621 | fringe_faces | 1621 | fringe_faces |
| 1622 | = (Lisp_Object *) xrealloc (fringe_faces, max_fringe_bitmaps * sizeof (Lisp_Object)); | 1622 | = (Lisp_Object *) xrealloc (fringe_faces, |
| 1623 | bitmaps * sizeof *fringe_faces); | ||
| 1623 | 1624 | ||
| 1624 | for (; i < max_fringe_bitmaps; i++) | 1625 | for (i = max_fringe_bitmaps; i < bitmaps; i++) |
| 1625 | { | 1626 | { |
| 1626 | fringe_bitmaps[i] = NULL; | 1627 | fringe_bitmaps[i] = NULL; |
| 1627 | fringe_faces[i] = Qnil; | 1628 | fringe_faces[i] = Qnil; |
| 1628 | } | 1629 | } |
| 1630 | |||
| 1631 | max_fringe_bitmaps = bitmaps; | ||
| 1629 | } | 1632 | } |
| 1630 | } | 1633 | } |
| 1631 | 1634 | ||