GNU bug report logs - #6830
widget-complete bad completions in :type 'file

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Mon, 9 Aug 2010 11:46:01 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


Message #96 received at 6830 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 6830 <at> debbugs.gnu.org
Subject: bug#6830: widget-complete bad completions in :type 'file
Date: Mon, 12 Mar 2012 01:36:41 -0700
That patch assumes that s1 != s2.  This assumption about qsort
is quite likely true on Windows but it's not guaranteed by
the C standard, and for portability it's better to play it safe
and stick with the pattern that's already in the code.
I installed this further patch:

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2012-03-12 06:34:32 +0000
+++ src/ChangeLog	2012-03-12 08:27:25 +0000
@@ -1,3 +1,7 @@
+2012-03-12  Paul Eggert  <eggert <at> cs.ucla.edu>
+
+	* buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
+
 2012-03-12  Chong Yidong  <cyd <at> gnu.org>
 
 	* eval.c (inhibit_lisp_code): Rename from

=== modified file 'src/buffer.c'
--- src/buffer.c	2012-03-09 16:46:25 +0000
+++ src/buffer.c	2012-03-12 08:27:25 +0000
@@ -2868,7 +2868,9 @@
      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.





This bug report was last modified 13 years and 75 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.