NOTE: This patch has been committed.
src/ChangeLog addition:
2005-09-26 Ben Wing <ben(a)xemacs.org>
* rangetab.c:
* rangetab.c (Fmap_range_table):
Fix bug in handling of range endpoints when not start-closed, end-open.
build source patch:
Diff command: bash -ci "cvs-diff --show-c-function -no-changelog "
Files affected: src/rangetab.c
Mon Sep 26 03:27:36 CDT 2005
Index: src/rangetab.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/rangetab.c,v
retrieving revision 1.23
diff -u -p -r1.23 rangetab.c
--- src/rangetab.c 2005/04/08 23:11:31 1.23
+++ src/rangetab.c 2005/09/26 08:27:52
@@ -1,6 +1,6 @@
/* XEmacs routines to deal with range tables.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 1995, 2002, 2004 Ben Wing.
+ Copyright (C) 1995, 2002, 2004, 2005 Ben Wing.
This file is part of XEmacs.
@@ -606,8 +606,20 @@ exactly once) if FUNCTION modifies or de
last = entry->last;
oldlen = Dynarr_length (rt->entries);
args[0] = function;
- args[1] = make_int (first);
- args[2] = make_int (last);
+ /* Fix up the numbers in accordance with the open/closedness of the
+ table. */
+ {
+ EMACS_INT premier = first, dernier = last;
+ switch (rt->type)
+ {
+ case RANGE_START_CLOSED_END_OPEN: break;
+ case RANGE_START_CLOSED_END_CLOSED: dernier--; break;
+ case RANGE_START_OPEN_END_OPEN: premier--; break;
+ case RANGE_START_OPEN_END_CLOSED: premier--, dernier--; break;
+ }
+ args[1] = make_int (premier);
+ args[2] = make_int (dernier);
+ }
args[3] = entry->val;
Ffuncall (countof (args), args);
/* Has FUNCTION removed the entry? */