changeset 4422:cb33e804774d

Automated merge with file:/Sources/xemacs-21.5-checked-out
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 12 Feb 2008 21:54:27 +0100
parents 69b803c646cd (diff) 6ed8c4ccc17e (current diff)
children 1982c8c55632
files install.sh
diffstat 4 files changed, 36 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Feb 12 10:09:19 2008 -0700
+++ b/src/ChangeLog	Tue Feb 12 21:54:27 2008 +0100
@@ -1,3 +1,11 @@
+2008-02-11  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* search.c (search_buffer): 
+	In the event that a character is not representable in the buffer,
+	fail immediately. Prevents an assertion failure in the code to
+	deal with whether Boyer-Moore search can be used for such
+	characters.
+
 2008-02-03  Jerry James  <james@xemacs.org>
 
 	* redisplay.c (generate_displayable_area): If a line has been
--- a/src/search.c	Tue Feb 12 10:09:19 2008 -0700
+++ b/src/search.c	Tue Feb 12 21:54:27 2008 +0100
@@ -1385,7 +1385,7 @@
               && (translated != c || inverse != c))
             {
 	      Ichar starting_c = c;
-	      int charset_base_code;
+	      int charset_base_code, checked = 0;
 
 	      do 
 		{
@@ -1399,6 +1399,8 @@
                   if (c > 0xFF && nothing_greater_than_0xff)
                     continue;
 
+                  checked = 1;
+
                   if (-1 == charset_base) /* No charset yet specified. */
                     {
                       /* Keep track of which charset and character set row
@@ -1425,6 +1427,23 @@
                     }
                 } while (c != starting_c);
 
+              if (!checked)
+                {
+#ifdef DEBUG_XEMACS
+                  if (debug_xemacs_searches)
+                    {
+                      Lisp_Symbol *sym = XSYMBOL (Qsearch_algorithm_used);
+                      sym->value = Qnil;
+                    }
+#endif
+                  /* The "continue" clauses were used above, for every
+                     translation of the character. As such, this character
+                     is not to be found in the buffer and neither is the
+                     string as a whole. Return immediately; also avoid
+                     triggering the assertion a few lines down. */
+                  return n > 0 ? -n : n;
+                }
+
               if (boyer_moore_ok && charset_base != -1 && 
                   charset_base != (translated & ~ICHAR_FIELD3_MASK))
                 {
--- a/tests/ChangeLog	Tue Feb 12 10:09:19 2008 -0700
+++ b/tests/ChangeLog	Tue Feb 12 21:54:27 2008 +0100
@@ -1,3 +1,8 @@
+2008-02-11  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/case-tests.el (Assert): 
+	New test case; thank you Michael Sperber. 
+
 2008-01-30  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* automated/case-tests.el (pristine-case-table): 
--- a/tests/automated/case-tests.el	Tue Feb 12 10:09:19 2008 -0700
+++ b/tests/automated/case-tests.el	Tue Feb 12 21:54:27 2008 +0100
@@ -284,6 +284,9 @@
   (goto-char (point-min))
   (Assert (search-forward "Flei\xdf")))
 
+(with-temp-buffer
+  (Assert (search-forward "M\xe9zard" nil t)))
+
 (Skip-Test-Unless
  (boundp 'debug-xemacs-searches) ; normal when we have DEBUG_XEMACS
  "not a DEBUG_XEMACS build"