Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37492249
en ru br
Репозитории ALT
S:7.0.3-alt1
5.1: 4.13-alt7
4.1: 4.11-alt3
4.0: 4.8-alt4
3.0: 4.8-alt2
www.altlinux.org/Changes

Группа :: Издательство
Пакет: texinfo

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: texinfo-4.13-cvs-info.patch
Скачать


--- a/info/dir.c
+++ b/info/dir.c
@@ -2,7 +2,7 @@
    $Id$
 
    Copyright (C) 1993, 1997, 1998, 2004, 2007, 
-   2008 Free Software Foundation, Inc.
+   2008, 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -180,11 +180,9 @@ add_menu_to_file_buffer (char *contents, long int size, FILE_BUFFER *fb)
   fb_binding.flags = S_FoldCase | S_SkipDest;
 
   /* Move to the start of the menus in CONTENTS and FB. */
-  contents_offset = search_forward (INFO_MENU_LABEL, &contents_binding);
-  fb_offset = search_forward (INFO_MENU_LABEL, &fb_binding);
-
-  /* If there is no menu in CONTENTS, quit now. */
-  if (contents_offset == -1)
+  if (search_forward (INFO_MENU_LABEL, &contents_binding, &contents_offset)
+      != search_success)
+    /* If there is no menu in CONTENTS, quit now. */
     return;
 
   /* There is a menu in CONTENTS, and contents_offset points to the first
@@ -193,7 +191,8 @@ add_menu_to_file_buffer (char *contents, long int size, FILE_BUFFER *fb)
   contents_offset += skip_whitespace_and_newlines (contents + contents_offset);
 
   /* If there is no menu in FB, make one. */
-  if (fb_offset == -1)
+  if (search_forward (INFO_MENU_LABEL, &fb_binding, &fb_offset)
+      != search_success)
     {
       /* Find the start of the second node in this file buffer.  If there
          is only one node, we will be adding the contents to the end of
@@ -224,8 +223,8 @@ add_menu_to_file_buffer (char *contents, long int size, FILE_BUFFER *fb)
       fb_binding.buffer = fb->contents;
       fb_binding.start = 0;
       fb_binding.end = fb->filesize;
-      fb_offset = search_forward (INFO_MENU_LABEL, &fb_binding);
-      if (fb_offset == -1)
+      if (search_forward (INFO_MENU_LABEL, &fb_binding, &fb_offset)
+	  != search_success)
         abort ();
     }
 
--- a/info/display.c
+++ b/info/display.c
@@ -272,7 +272,7 @@ display_update_one_window (WINDOW *win)
       if (display_was_interrupted_p)
 	return;
     }
-  
+
   /* We have reached the end of the node or the end of the window.  If it
      is the end of the node, then clear the lines of the window from here
      to the end of the window. */
@@ -311,7 +311,6 @@ display_update_one_window (WINDOW *win)
           strcpy (display[line_index]->text, win->modeline);
           display[line_index]->inverse = 1;
           display[line_index]->textlen = strlen (win->modeline);
-          fflush (stdout);
         }
     }
 
--- a/info/info-utils.c
+++ b/info/info-utils.c
@@ -1,7 +1,7 @@
 /* info-utils.c -- miscellanous.
    $Id$
 
-   Copyright (C) 1993, 1998, 2003, 2004, 2007, 2008
+   Copyright (C) 1993, 1998, 2003, 2004, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -74,14 +74,34 @@ info_parse_node (char *string, int newlines_okay)
   /* Check for (FILENAME)NODENAME. */
   if (*string == '(')
     {
+      int bcnt;
+      int bfirst;
+      
       i = 0;
       /* Advance past the opening paren. */
       string++;
 
-      /* Find the closing paren. */
-      while (string[i] && string[i] != ')')
-        i++;
+      /* Find the closing paren. Handle nested parens correctly. */
+      for (bcnt = 0, bfirst = -1; string[i]; i++)
+	{
+	  if (string[i] == ')')
+	    {
+	      if (bcnt == 0)
+		{
+		  bfirst = -1;
+		  break;
+		}
+	      else if (!bfirst)
+		bfirst = i;
+	      bcnt--;
+	    } 
+	  else if (string[i] == '(')
+	    bcnt++;
+	}
 
+      if (bfirst >= 0)
+	i = bfirst;
+      
       /* Remember parsed filename. */
       saven_filename (string, i);
 
@@ -181,9 +201,8 @@ info_menu_of_node (NODE *node)
   tmp_search.flags = S_FoldCase;
 
   /* Find the start of the menu. */
-  position = search_forward (INFO_MENU_LABEL, &tmp_search);
-
-  if (position == -1)
+  if (search_forward (INFO_MENU_LABEL, &tmp_search, &position)
+      != search_success)
     return NULL;
 
   /* We have the start of the menu now.  Glean menu items from the rest
@@ -252,7 +271,7 @@ info_references_internal (char *label, SEARCH_BINDING *binding)
 
   searching_for_menu_items = (mbscasecmp (label, INFO_MENU_ENTRY_LABEL) == 0);
 
-  while ((position = search_forward (label, &tmp_search)) != -1)
+  while (search_forward (label, &tmp_search, &position) == search_success)
     {
       int offset, start;
       char *refdef;
--- a/info/man.c
+++ b/info/man.c
@@ -2,7 +2,7 @@
     $Id$
 
    Copyright (C) 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 
-   2007, 2008 Free Software Foundation, Inc.
+   2007, 2008, 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -499,8 +499,8 @@ find_reference_section (NODE *node)
 
   for (i = 0; reference_section_starters[i] != NULL; i++)
     {
-      position = search_forward (reference_section_starters[i], &frs_binding);
-      if (position != -1)
+      if (search_forward (reference_section_starters[i], &frs_binding,
+			  &position) == search_success)
         break;
     }
 
@@ -544,7 +544,7 @@ xrefs_of_manpage (NODE *node)
      within parenthesis. */
   reference_section->flags = 0;
 
-  while ((position = search_forward ("(", reference_section)) != -1)
+  while (search_forward ("(", reference_section, &position) == search_success)
     {
       register int start, end;
 
--- a/info/nodes.c
+++ b/info/nodes.c
@@ -2,7 +2,7 @@
    $Id$
 
    Copyright (C) 1993, 1998, 1999, 2000, 2002, 2003, 2004, 2006, 2007,
-   2008 Free Software Foundation, Inc.
+   2008, 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -106,14 +106,18 @@ info_get_node (char *filename, char *nodename)
   file_buffer = info_find_file (filename);
   if (!file_buffer)
     {
-      if (filesys_error_number)
-        info_recent_file_error =
-          filesys_error_string (filename, filesys_error_number);
-      return NULL;
+      node = make_manpage_node (filename);
+      if (!node)
+	{
+	  if (filesys_error_number)
+	    info_recent_file_error =
+	      filesys_error_string (filename, filesys_error_number);
+	  return NULL;
+	}
     }
-
-  /* Look for the node.  */
-  node = info_get_node_of_file_buffer (nodename, file_buffer);
+  else
+    /* Look for the node.  */
+    node = info_get_node_of_file_buffer (nodename, file_buffer);
 
   /* If the node not found was "Top", try again with different case,
      unless this was a man page.  */
@@ -405,11 +409,10 @@ build_tags_and_nodes (FILE_BUFFER *file_buffer)
     binding.end = 0;
   binding.flags = S_FoldCase;
 
-  position = search_backward (TAGS_TABLE_END_LABEL, &binding);
-
-  /* If there is a tag table, find the start of it, and grovel over it
-     extracting tag information. */
-  if (position != -1)
+  if (search_backward (TAGS_TABLE_END_LABEL, &binding, &position)
+      == search_success)
+    /* If there is a tag table, find the start of it, and grovel over it
+       extracting tag information. */
     while (1)
       {
         long tags_table_begin, tags_table_end;
@@ -432,9 +435,8 @@ build_tags_and_nodes (FILE_BUFFER *file_buffer)
         binding.end = 0;
 
         /* Locate the start of the tags table. */
-        position = search_backward (TAGS_TABLE_BEG_LABEL, &binding);
-
-        if (position == -1)
+        if (search_backward (TAGS_TABLE_BEG_LABEL, &binding, &position)
+	    != search_success)
           break;
 
         binding.end = position;
@@ -472,9 +474,8 @@ build_tags_and_nodes (FILE_BUFFER *file_buffer)
             indirect.buffer = binding.buffer;
             indirect.flags = S_FoldCase;
 
-            position = search_backward (INDIRECT_TAGS_TABLE_LABEL, &indirect);
-
-            if (position == -1)
+            if (search_backward (INDIRECT_TAGS_TABLE_LABEL, &indirect,
+				 &position) != search_success)
               {
                 /* This file is malformed.  Give up. */
                 return;
@@ -618,7 +619,7 @@ get_nodes_of_tags_table (FILE_BUFFER *file_buffer,
 
   /* The tag table consists of lines containing node names and positions.
      Do each line until we find one that doesn't contain a node name. */
-  while ((position = search_forward ("\n", tmp_search)) != -1)
+  while (search_forward ("\n", tmp_search, &position) == search_success)
     {
       TAG *entry;
       char *nodedef;
--- a/info/search.c
+++ b/info/search.c
@@ -1,7 +1,7 @@
 /* search.c -- searching large bodies of text.
    $Id$
 
-   Copyright (C) 1993, 1997, 1998, 2002, 2004, 2007, 2008
+   Copyright (C) 1993, 1997, 1998, 2002, 2004, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -70,16 +70,16 @@ copy_binding (SEARCH_BINDING *binding)
 
 /* Search forwards or backwards for the text delimited by BINDING.
    The search is forwards if BINDING->start is greater than BINDING->end. */
-long
-search (char *string, SEARCH_BINDING *binding)
+enum search_result
+search (char *string, SEARCH_BINDING *binding, long *poff)
 {
-  long result;
+  enum search_result result;
 
   /* If the search is backwards, then search backwards, otherwise forwards. */
   if (binding->start > binding->end)
-    result = search_backward (string, binding);
+    result = search_backward (string, binding, poff);
   else
-    result = search_forward (string, binding);
+    result = search_forward (string, binding, poff);
 
   return result;
 }
@@ -88,13 +88,13 @@ search (char *string, SEARCH_BINDING *binding)
    delimited by BINDING. The search is forwards if BINDING->start is greater
    than BINDING->end.
 
-   If PRET is specified, it receives a copy of BINDING at the end of a
+   If PEND is specified, it receives a copy of BINDING at the end of a
    succeded search.  Its START and END fields contain bounds of the found
    string instance. 
 */
-long
+enum search_result
 regexp_search (char *regexp, SEARCH_BINDING *binding, long length,
-	       SEARCH_BINDING *pret)
+	       long *poff, SEARCH_BINDING *pend)
 {
   static char *previous_regexp = NULL;
   static char *previous_content = NULL;
@@ -164,7 +164,7 @@ regexp_search (char *regexp, SEARCH_BINDING *binding, long length,
           char *buf = xmalloc (size);
           regerror (result, &preg, buf, size);
           info_error (_("regexp error: %s"), buf, NULL);
-          return -1;
+          return search_failure;
         }
 
       previous_regexp = xstrdup(regexp);
@@ -225,14 +225,15 @@ regexp_search (char *regexp, SEARCH_BINDING *binding, long length,
         {
           if (matches[i].rm_so <= pos)
 	    {
-	      if (pret)
+	      if (pend)
 		{
-		  pret->buffer = binding->buffer;
-		  pret->flags = binding->flags;
-		  pret->start = matches[i].rm_so;
-		  pret->end = matches[i].rm_eo;
+		  pend->buffer = binding->buffer;
+		  pend->flags = binding->flags;
+		  pend->start = matches[i].rm_so;
+		  pend->end = matches[i].rm_eo;
 		}
-	      return matches[i].rm_so;
+	      *poff = matches[i].rm_so;
+	      return search_success;
 	    }
         }
     }
@@ -244,28 +245,29 @@ regexp_search (char *regexp, SEARCH_BINDING *binding, long length,
         {
           if (matches[i].rm_so >= pos)
             {
-	      if (pret)
+	      if (pend)
 		{
-		  pret->buffer = binding->buffer;
-		  pret->flags = binding->flags;
-		  pret->start = matches[i].rm_so;
-		  pret->end = matches[i].rm_eo;
+		  pend->buffer = binding->buffer;
+		  pend->flags = binding->flags;
+		  pend->start = matches[i].rm_so;
+		  pend->end = matches[i].rm_eo;
 		}
               if (binding->flags & S_SkipDest)
-                return matches[i].rm_eo;
+                *poff = matches[i].rm_eo;
               else
-                return matches[i].rm_so;
+                *poff = matches[i].rm_so;
+	      return search_success;
             }
         }
     }
 
   /* not found */
-  return -1;
+  return search_not_found;
 }
 
 /* Search forwards for STRING through the text delimited in BINDING. */
-long
-search_forward (char *string, SEARCH_BINDING *binding)
+enum search_result
+search_forward (char *string, SEARCH_BINDING *binding, long *poff)
 {
   register int c, i, len;
   register char *buff, *end;
@@ -310,7 +312,8 @@ search_forward (char *string, SEARCH_BINDING *binding)
             free (alternate);
           if (binding->flags & S_SkipDest)
             buff += len;
-          return buff - binding->buffer;
+          *poff = buff - binding->buffer;
+	  return search_success;
         }
 
       buff++;
@@ -319,12 +322,12 @@ search_forward (char *string, SEARCH_BINDING *binding)
   if (alternate)
     free (alternate);
 
-  return -1;
+  return search_not_found;
 }
 
 /* Search for STRING backwards through the text delimited in BINDING. */
-long
-search_backward (char *input_string, SEARCH_BINDING *binding)
+enum search_result
+search_backward (char *input_string, SEARCH_BINDING *binding, long *poff)
 {
   register int c, i, len;
   register char *buff, *end;
@@ -379,7 +382,8 @@ search_backward (char *input_string, SEARCH_BINDING *binding)
 
           if (binding->flags & S_SkipDest)
             buff -= len;
-          return 1 + buff - binding->buffer;
+          *poff = 1 + buff - binding->buffer;
+	  return search_success;
         }
 
       buff--;
@@ -389,7 +393,7 @@ search_backward (char *input_string, SEARCH_BINDING *binding)
   if (alternate)
     free (alternate);
 
-  return -1;
+  return search_not_found;
 }
 
 /* Find STRING in LINE, returning the offset of the end of the string.
@@ -400,7 +404,8 @@ string_in_line (char *string, char *line)
 {
   register int end;
   SEARCH_BINDING binding;
-
+  long offset;
+  
   /* Find the end of the line. */
   for (end = 0; line[end] && line[end] != '\n'; end++);
 
@@ -410,7 +415,9 @@ string_in_line (char *string, char *line)
   binding.end = end;
   binding.flags = S_FoldCase | S_SkipDest;
 
-  return search_forward (string, &binding);
+  if (search_forward (string, &binding, &offset) == search_success)
+    return offset;
+  return -1;
 }
 
 /* Return non-zero if STRING is the first text to appear at BINDING. */
@@ -419,7 +426,8 @@ looking_at (char *string, SEARCH_BINDING *binding)
 {
   long search_end;
 
-  search_end = search (string, binding);
+  if (search (string, binding, &search_end) != search_success)
+    return 0;
 
   /* If the string was not found, SEARCH_END is -1.  If the string was found,
      but not right away, SEARCH_END is != binding->start.  Otherwise, the
--- a/info/search.h
+++ b/info/search.h
@@ -1,7 +1,7 @@
 /* search.h -- Structure used to search large bodies of text, with bounds.
    $Id$
 
-   Copyright (C) 1993, 1997, 1998, 2002, 2004, 2007
+   Copyright (C) 1993, 1997, 1998, 2002, 2004, 2007, 2009
    Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -42,13 +42,26 @@ typedef struct {
 #define S_FoldCase      0x01    /* Set means fold case in searches. */
 #define S_SkipDest      0x02    /* Set means return pointing after the dest. */
 
+enum search_result
+  {
+    search_success,             
+    search_not_found,
+    search_failure
+  };
+
 SEARCH_BINDING *make_binding (char *buffer, long int start, long int end);
 SEARCH_BINDING *copy_binding (SEARCH_BINDING *binding);
-extern long search_forward (char *string, SEARCH_BINDING *binding);
-extern long search_backward (char *input_string, SEARCH_BINDING *binding);
-extern long search (char *string, SEARCH_BINDING *binding);
-extern long regexp_search (char *regexp, SEARCH_BINDING *binding, long length,
-			   SEARCH_BINDING *pret);
+extern enum search_result search_forward (char *string,
+					  SEARCH_BINDING *binding, long *poff);
+extern enum search_result search_backward (char *input_string,
+					   SEARCH_BINDING *binding,
+					   long *poff);
+extern enum search_result search (char *string, SEARCH_BINDING *binding,
+				  long *poff);
+extern enum search_result regexp_search (char *regexp,
+					 SEARCH_BINDING *binding, long length,
+					 long *poff,
+					 SEARCH_BINDING *pret);
 extern int looking_at (char *string, SEARCH_BINDING *binding);
 
 /* Note that STRING_IN_LINE () always returns the offset of the 1st character
--- a/info/session.c
+++ b/info/session.c
@@ -2,7 +2,7 @@
    $Id$
 
    Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2007, 2008 Free Software Foundation, Inc.
+   2004, 2007, 2008, 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -538,14 +538,18 @@ set_window_pagetop (WINDOW *window, int desired_top)
      direction.  Do this only if there would be a savings in redisplay
      time.  This is true if the amount to scroll is less than the height
      of the window, and if the number of lines scrolled would be greater
-     than 10 % of the window's height. */
+     than 10 % of the window's height.
+
+     To prevent status line blinking when keeping up or down key,
+     scrolling is disabled if the amount to scroll is 1. */
   if (old_pagetop < desired_top)
     {
       int start, end, amount;
 
       amount = desired_top - old_pagetop;
 
-      if ((amount >= window->height) ||
+      if (amount == 1 ||
+	  (amount >= window->height) ||
           (((window->height - amount) * 10) < window->height))
         return;
 
@@ -560,7 +564,8 @@ set_window_pagetop (WINDOW *window, int desired_top)
 
       amount = old_pagetop - desired_top;
 
-      if ((amount >= window->height) ||
+      if (amount == 1 ||
+	  (amount >= window->height) ||
           (((window->height - amount) * 10) < window->height))
         return;
 
@@ -657,6 +662,22 @@ DECLARE_INFO_COMMAND (info_next_line, _("Move down to the next line"))
       }
 }
 
+/* "Safe" version of info_next_line, for use when moving to a
+   reference within the window.  It assumes that point is 0 and
+   is safe in the sense that it won't allow to change nodes if
+   COUNT is greater than the number of lines in the current node.
+
+   This is necessary to avoid incorrect placement on malformed
+   info documents (such as gawk.info v. 3.1.5) when
+   cursor_movement_scrolls_p is set to 1. */
+
+static void
+internal_next_line (WINDOW *window, int count, unsigned char key)
+{
+  if (count >= 0 && count < window->line_count)
+    info_next_line (window, count, key);
+}
+  
 /* Move WINDOW's point up to the previous line if possible. */
 DECLARE_INFO_COMMAND (info_prev_line, _("Move up to the previous line"))
 {
@@ -2285,7 +2306,7 @@ DECLARE_INFO_COMMAND (info_menu_digit, _("Select this menu item"))
     {
       info_select_reference (window, menu[i]);
       if (menu[i]->line_number > 0)
-        info_next_line (window, menu[i]->line_number - 1, key);
+        internal_next_line (window, menu[i]->line_number - 1, key);
     }
   else
     info_error (_("There aren't %d items in this menu."),
@@ -2605,7 +2626,7 @@ info_menu_or_ref_item (WINDOW *window, int count,
             if (entry->line_number > 0)
               /* next_line starts at line 1?  Anyway, the -1 makes it
                  move to the right line.  */
-              info_next_line (window, entry->line_number - 1, key);
+              internal_next_line (window, entry->line_number - 1, key);
         }
 
       free (line);
@@ -2650,16 +2671,14 @@ DECLARE_INFO_COMMAND (info_find_menu, _("Move to the start of this node's menu")
   binding.end = window->node->nodelen;
   binding.flags = S_FoldCase | S_SkipDest;
 
-  position = search (INFO_MENU_LABEL, &binding);
-
-  if (position == -1)
-    info_error (msg_no_menu_node, NULL, NULL);
-  else
+  if (search (INFO_MENU_LABEL, &binding, &position) == search_success)
     {
       window->point = position;
       window_adjust_pagetop (window);
       window->flags |= W_UpdateWindow;
     }
+  else
+    info_error (msg_no_menu_node, NULL, NULL);
 }
 
 /* Visit as many menu items as is possible, each in a separate window. */
@@ -3708,26 +3727,25 @@ file_buffer_of_window (WINDOW *window)
   return NULL;
 }
 
-/* Search for STRING in NODE starting at START.  Return -1 if the string
-   was not found, or the location of the string if it was.  If WINDOW is
-   passed as non-null, set the window's node to be NODE, its point to be
-   the found string, and readjust the window's pagetop.  The DIR argument
-   says which direction to search in.  If it is positive, search
-   forward, else backwards.
+/* Search for STRING in NODE starting at START.  If the string was found,
+   return its location in POFF.  If WINDOW is passed as non-null, set the
+   window's node to be NODE, its point to be the found string, and readjust
+   the window's pagetop.  The DIR argument says which direction to search
+   in.  If it is positive, search forward, else backwards.
 
    The last argument, RESBND, makes sense only when USE_REGEX is set.
    If the regexp search succeeds, RESBND is filled with the final state
    of the search binding.  In particular, its START and END fields contain
    bounds of the found string instance.
 */
-static long
+static enum search_result
 info_search_in_node_internal (char *string, NODE *node, long int start,
 			      WINDOW *window, int dir, int case_sensitive,
-			      SEARCH_BINDING *resbnd)
+			      long *poff, SEARCH_BINDING *resbnd)
 {
   SEARCH_BINDING binding;
-  long offset;
-
+  enum search_result result;
+  
   binding.buffer = node->contents;
   binding.start = start;
   binding.end = node->nodelen;
@@ -3748,27 +3766,30 @@ info_search_in_node_internal (char *string, NODE *node, long int start,
   if (isearch_is_active)
     binding.flags |= S_SkipDest;
 
-  offset = (use_regex ? 
-            regexp_search (string, &binding, node->nodelen, resbnd):
-            search (string, &binding));
-
-  if (offset != -1 && window)
+  result = (use_regex ? 
+	    regexp_search (string, &binding, node->nodelen, poff, resbnd):
+	    search (string, &binding, poff));
+  if (result == search_success && window)
     {
       set_remembered_pagetop_and_point (window);
       if (window->node != node)
         window_set_node_of_window (window, node);
-      window->point = offset;
+      window->point = *poff;
       window_adjust_pagetop (window);
     }
-  return offset;
+  return result;
 }
 
 long
 info_search_in_node (char *string, NODE *node, long int start,
 		     WINDOW *window, int dir, int case_sensitive)
 {
-  return info_search_in_node_internal (string, node, start,
-				       window, dir, case_sensitive, NULL);
+  long offset;
+  if (info_search_in_node_internal (string, node, start,
+				    window, dir, case_sensitive,
+				    &offset, NULL) == search_success)
+    return offset;
+  return -1;
 }
 
 /* Search NODE, looking for the largest possible match of STRING.  Start the
@@ -3824,7 +3845,8 @@ info_search_internal (char *string, WINDOW *window,
   FILE_BUFFER *file_buffer;
   char *initial_nodename;
   long ret, start;
-
+  enum search_result result;
+  
   file_buffer = file_buffer_of_window (window);
   initial_nodename = window->node->nodename;
 
@@ -3838,16 +3860,23 @@ info_search_internal (char *string, WINDOW *window,
        ``finding'' a string that is already under the cursor, anyway.  */
     start = window->point + dir;
   
-  ret = info_search_in_node_internal
-        (string, window->node, start, window, dir,
-         case_sensitive, resbnd);
-  
-  if (ret != -1)
+  result = info_search_in_node_internal
+             (string, window->node, start, window, dir,
+	      case_sensitive, &ret, resbnd);
+
+  switch (result)
     {
+    case search_success:
       /* We won! */
       if (!echo_area_is_active && !isearch_is_active)
         window_clear_echo_area ();
       return 0;
+
+    case search_not_found:
+      break;
+      
+    case search_failure:
+      return -1;
     }
   
   start = 0;
@@ -3945,12 +3974,12 @@ info_search_internal (char *string, WINDOW *window,
           if (dir < 0)
             start = tag->nodelen;
 
-          ret =
+          result =
             info_search_in_node_internal (string, node, start, window, dir,
-					  case_sensitive, resbnd);
+					  case_sensitive, &ret, resbnd);
 
           /* Did we find the string in this node? */
-          if (ret != -1)
+          if (result == search_success)
             {
               /* Yes!  We win. */
               remember_window_and_node (window, node);
@@ -3968,7 +3997,8 @@ info_search_internal (char *string, WINDOW *window,
              our starting point. */
           free (node);
 
-          if (strcmp (initial_nodename, tag->nodename) == 0)
+          if (result == search_failure
+	      || strcmp (initial_nodename, tag->nodename) == 0)
             return -1;
         }
     }
--- a/info/window.c
+++ b/info/window.c
@@ -1581,8 +1581,8 @@ process_node_text (WINDOW *win, char *start,
       const char *carried_over_ptr;
       size_t carried_over_len, carried_over_count;
       const char *cur_ptr = mbi_cur_ptr (iter);
-      int cur_len = mb_len (mbi_cur (iter));
-      int replen;
+      size_t cur_len = mb_len (mbi_cur (iter));
+      size_t replen;
       int delim = 0;
       int rc;
 
@@ -1754,7 +1754,7 @@ clean_manpage (char *manpage)
        mbi_advance (iter))
     {
       const char *cur_ptr = mbi_cur_ptr (iter);
-      int cur_len = mb_len (mbi_cur (iter));
+      size_t cur_len = mb_len (mbi_cur (iter));
 
       if (cur_len == 1)
 	{
@@ -1831,7 +1831,7 @@ window_line_map_init (WINDOW *win)
  */
 int
 window_scan_line (WINDOW *win, int line, int phys,
-		  void (*fun) (void *closure, long cpos, int replen),
+		  void (*fun) (void *closure, long cpos, size_t replen),
 		  void *closure)
 {
   mbi_iterator_t iter;
@@ -1852,8 +1852,8 @@ window_scan_line (WINDOW *win, int line, int phys,
        mbi_advance (iter))
     {
       const char *cur_ptr = mbi_cur_ptr (iter);
-      int cur_len = mb_len (mbi_cur (iter));
-      int replen;
+      size_t cur_len = mb_len (mbi_cur (iter));
+      size_t replen;
 
       if (cur_ptr >= endp)
 	break;
@@ -1903,7 +1903,7 @@ window_scan_line (WINDOW *win, int line, int phys,
 }
 
 static void
-add_line_map (void *closure, long cpos, int replen)
+add_line_map (void *closure, long cpos, size_t replen)
 {
   WINDOW *win = closure;
 
--- a/makeinfo/sectioning.c
+++ b/makeinfo/sectioning.c
@@ -119,7 +119,7 @@ get_sectioning_number (int level, int num)
   if ((num == ENUM_SECT_APP)
       && (i == 0)
       && (enum_marker == APPENDIX_MAGIC))
-    sprintf (p, _("Appendix %c"), numbers[i] + 64);
+    sprintf (p, getdocumenttext ("Appendix %c"), numbers[i] + 64);
   else
     sprintf (p, "%d", numbers[i]);
 
@@ -256,14 +256,14 @@ current_chapter_number (void)
     return xstrdup ("");
   else if (enum_marker == APPENDIX_MAGIC)
     {
-      char s[1];
+      char s[2];
       sprintf (s, "%c", numbers[0] + 64);
       return xstrdup (s);
     }
   else
     {
       char s[5];
-      sprintf (s, "%d", numbers[0]);
+      sprintf (s, "%4d", numbers[0]);
       return xstrdup (s);
     }
 }
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin