diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-07-27 07:28:56 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-07-27 07:28:56 +0000 |
commit | f7bc2e6134814c15ca726854fe2b826b55498ea9 (patch) | |
tree | 70e83f8487c76350a586f43b1877bd08aeed2345 /mail | |
parent | 201b6c4154744c4ad420c6129bfc34ebbfad60a9 (diff) | |
download | mailutils-f7bc2e6134814c15ca726854fe2b826b55498ea9.tar.gz mailutils-f7bc2e6134814c15ca726854fe2b826b55498ea9.tar.bz2 |
(top_of_page,cursor,page_map,page_size)
(page_avail,page_map): Hide as static
(fill_page_map): Reset cursor if it points past the last
message.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/page.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/mail/page.c b/mail/page.c index e4d480afd..c625cb02c 100644 --- a/mail/page.c +++ b/mail/page.c @@ -18,15 +18,15 @@ #include "mail.h" -size_t top_of_page = 1; /* Number of the topmost message on the page */ -size_t cursor; /* Number of current message */ +static size_t top_of_page = 1; /* Number of the topmost message on the page */ +static size_t cursor; /* Number of current message */ -size_t *page_map; /* Array of message numbers. page_map[N] holds - number of the message occupying Nth line on - the screen */ -unsigned page_size; /* Capacity of page_map */ -unsigned page_avail; /* First non-used entry in page map. Can be - equal to page_size */ +static size_t *page_map; /* Array of message numbers. page_map[N] holds + number of the message occupying Nth line on + the screen */ +static unsigned page_size; /* Capacity of page_map */ +static unsigned page_avail; /* First non-used entry in page map. Can be + equal to page_size */ /* Auxiliary function: Store number of message from mspec into page_map */ static int @@ -46,6 +46,8 @@ fill_page_map () util_range_msg (top_of_page, page_size, MSG_COUNT|MSG_NODELETED|MSG_SILENT, _fill_map, &page_avail); + if (cursor >= page_avail) + cursor = page_avail - 1; } /* Check if the page_map is valid. If not, fill it. |