texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[5759] no min search length for index lookup


From: Gavin D. Smith
Subject: [5759] no min search length for index lookup
Date: Wed, 20 Aug 2014 12:07:52 +0000

Revision: 5759
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5759
Author:   gavin
Date:     2014-08-20 12:07:50 +0000 (Wed, 20 Aug 2014)
Log Message:
-----------
no min search length for index lookup

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/indices.c
    trunk/info/session.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-08-18 14:04:49 UTC (rev 5758)
+++ trunk/ChangeLog     2014-08-20 12:07:50 UTC (rev 5759)
@@ -1,3 +1,12 @@
+2014-08-20  Gavin Smith  <address@hidden>
+
+       * info/indices.c (do_info_index_search, info_virtual_index): Remove
+       check against min_search_length.
+       * info/session.c (info_search_1): Don't allocate for search_string
+       here.
+       (info_search_next, info_search_previous): Check if search_string is
+       null.
+
 2014-08-18  Gavin Smith  <address@hidden>
 
        * info/indices.c (info_virtual_index): Place index marker tag in

Modified: trunk/info/indices.c
===================================================================
--- trunk/info/indices.c        2014-08-18 14:04:49 UTC (rev 5758)
+++ trunk/info/indices.c        2014-08-20 12:07:50 UTC (rev 5759)
@@ -241,14 +241,6 @@
             }
         }
     }
-
-  if (mbslen (line) < min_search_length)
-    {
-      info_error (_("Search string too short"));
-      free (line);
-      return;
-    }
-
   
   /* The user typed either a completed index label, or a partial string.
      Find an exact match, or, failing that, the first index entry containing
@@ -786,18 +778,12 @@
   line = info_read_maybe_completing (_("Index topic: "), index_index);
 
   /* User aborted? */
-  if (!line)
+  if (!line || !*line)
     {
+      free (line);
       info_abort_key (window, 1, 1);
       return;
     }
-
-  if (mbslen (line) < min_search_length)
-    {
-      info_error (_("Search string too short"));
-      free (line);
-      return;
-    }
   
   text_buffer_init (&text);
   text_buffer_printf (&text, _("Index for `%s'"), line);

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-08-18 14:04:49 UTC (rev 5758)
+++ trunk/info/session.c        2014-08-20 12:07:50 UTC (rev 5759)
@@ -3819,12 +3819,6 @@
   else
     start_off = start;
   
-  if (!search_string)
-    {
-      search_string = xmalloc (search_string_size = 100);
-      search_string[0] = '\0';
-    }
-
   /* If the search string includes upper-case letters, make the search
      case-sensitive.  */
   if (case_sensitive == 0)
@@ -3897,7 +3891,7 @@
 DECLARE_INFO_COMMAND (info_search_next,
                       _("Repeat last search in the same direction"))
 {
-  if (!last_search_direction)
+  if (!last_search_direction || !search_string)
     info_error ("%s", _("No previous search string"));
   else if (search_skip_screen_p)
     {
@@ -3918,7 +3912,7 @@
 DECLARE_INFO_COMMAND (info_search_previous,
                       _("Repeat last search in the reverse direction"))
 {
-  if (!last_search_direction)
+  if (!last_search_direction || !search_string)
     info_error ("%s", _("No previous search string"));
   else if (search_skip_screen_p)
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]