summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index efb9a80f35d..1fea19b0d65 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2868,7 +2868,9 @@ compare_overlays (const void *v1, const void *v2)
between "equal" overlays. The result can still change between
invocations of Emacs, but it won't change in the middle of
`find_field' (bug#6830). */
- return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1;
+ if (XHASH (s1->overlay) != XHASH (s2->overlay))
+ return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1;
+ return 0;
}
/* Sort an array of overlays by priority. The array is modified in place.