bug-texinfo
[Top][All Lists]
Advanced

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

Re: "info --vi-keys foo" inciting a segfault in info


From: Eli Zaretskii
Subject: Re: "info --vi-keys foo" inciting a segfault in info
Date: Mon, 27 Aug 2001 18:35:27 +0300 (IDT)

On Sun, 26 Aug 2001, Colin Watson wrote:

> Noticing that where_is_rep_index isn't always reset when (I think) it
> should be, that is each time where_is_internal() is called from
> create_internal_info_help_node(), this patch cured the segfault for me.

I prefer to initialize the index if it needs to be initialized; see
the alternative patch below.  Does it also solve the segfault for you?

> Speaking of which, 'h' is normally backward and 'l' forward in vi rather
> than the other way round.

Right, that should be changed, too.  Thanks for pointing this out.

2001-08-27  Eli Zaretskii  <address@hidden>

        * info/infodoc.c (create_internal_info_help_node): Initialize
        where_is_rep_index to zero.

--- info/infodoc.c~1    Sun Aug 26 14:24:08 2001
+++ info/infodoc.c      Mon Aug 27 16:15:32 2001
@@ -133,6 +133,10 @@ static char *info_help_keys_text[][2] = 
   NULL
 };
 
+static char *where_is_rep = (char *)NULL;
+static int where_is_rep_index = 0;
+static int where_is_rep_size = 0;
+
 static char *where_is (), *where_is_internal ();
 
 void
@@ -270,6 +274,8 @@ create_internal_info_help_node (help_is_
         {
           VFunction *func = function_doc_array[i].func;
 
+          where_is_rep_index = 0;
+
           if ((!where_is_internal (info_keymap, func)) &&
               (!where_is_internal (echo_area_keymap, func)))
             {
@@ -731,12 +737,6 @@ replace_in_documentation (string)
   return (result);
 }
 
-/* Return a string of characters which could be typed from the keymap
-   MAP to invoke FUNCTION. */
-static char *where_is_rep = (char *)NULL;
-static int where_is_rep_index = 0;
-static int where_is_rep_size = 0;
-
 /* Make sure there's enough room in where_is_rep to put a string whose
    size is SIZE, beginning from offset OFFSET.  If there's not enough
    room, reallocate where_is_rep.  */
@@ -751,6 +751,8 @@ where_is_make_room (offset, size)
     }
 }
 
+/* Return a string of characters which could be typed from the keymap
+   MAP to invoke FUNCTION. */
 static char *
 where_is (map, function)
      Keymap map;



reply via email to

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