From: Gerd Moellmann Date: Tue, 24 Oct 2000 14:05:50 +0000 (+0000) Subject: (size_window): Prevent setting window's width or X-Git-Tag: emacs-pretest-21.0.90~620 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7ae2f10f738ad485fba621f4f2cb175e1c8d2794;p=emacs.git (size_window): Prevent setting window's width or height to a negative value (esp. with XSETFASTINT). --- diff --git a/src/ChangeLog b/src/ChangeLog index 6f4ba7a5b09..97995aca06b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2000-10-24 Gerd Moellmann + * window.c (size_window): Prevent setting window's width or + height to a negative value (esp. with XSETFASTINT). + * gmalloc.c (state_protected_p, last_state_size, last_heapinfo) [GC_MALLOC_CHECK && GC_PROTECT_MALLOC_STATE]: New variables. (protect_malloc_state) [GC_MALLOC_CHECK && diff --git a/src/window.c b/src/window.c index 36f857e6465..3f08e64a26b 100644 --- a/src/window.c +++ b/src/window.c @@ -2314,6 +2314,7 @@ size_window (window, size, width_p, nodelete_p) int old_size, min_size; check_min_window_sizes (); + size = max (0, size); /* If the window has been "too small" at one point, don't delete it for being "too small" in the future. @@ -2350,22 +2351,22 @@ size_window (window, size, width_p, nodelete_p) } /* Set redisplay hints. */ - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + w->last_modified = make_number (0); + w->last_overlay_modified = make_number (0); windows_or_buffers_changed++; - FRAME_WINDOW_SIZES_CHANGED (XFRAME (WINDOW_FRAME (w))) = 1; + FRAME_WINDOW_SIZES_CHANGED (XFRAME (w->frame)) = 1; if (width_p) { sideward = &w->vchild; forward = &w->hchild; - XSETFASTINT (w->width, size); + w->width = make_number (size); } else { sideward = &w->hchild; forward = &w->vchild; - XSETFASTINT (w->height, size); + w->height = make_number (size); } if (!NILP (*sideward))