User: ben
Date: 05/09/26 10:29:35
Modified: xemacs/src ChangeLog rangetab.c
Log:
fix range table boundaries
rangetab.c: Fix bug in handling of range endpoints when not start-closed, end-open.
Revision Changes Path
1.858 +6 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.857
retrieving revision 1.858
diff -u -p -r1.857 -r1.858
--- ChangeLog 2005/09/24 16:31:37 1.857
+++ ChangeLog 2005/09/26 08:29:27 1.858
@@ -1,3 +1,9 @@
+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.
+
2005-09-17 Olivier Galibert <galibert(a)xemacs.org>
* intl.c (Fset_current_locale): setlocale return string is valid
1.24 +15 -3 XEmacs/xemacs/src/rangetab.c
Index: rangetab.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/rangetab.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -p -r1.23 -r1.24
--- rangetab.c 2005/04/08 23:11:31 1.23
+++ rangetab.c 2005/09/26 08:29:31 1.24
@@ -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? */
Show replies by date