bug-texinfo
[Top][All Lists]
Advanced

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

Re: Bug#74278: info: Segfault if return key pressed in "SEE ALSO" sectio


From: Eli Zaretskii
Subject: Re: Bug#74278: info: Segfault if return key pressed in "SEE ALSO" section
Date: Mon, 09 Oct 2000 17:29:30 +0200

> From: "H. Nanosecond" <address@hidden>
> Date: Mon, 9 Oct 2000 05:35:04 -0400 (EDT)
> 
> If the cursor is before the first reference when you press enter
> then the variable 'which' will be -1 after the loop,
> causing a memory error when refs[which] is accessed.
> 
> SEE ALSO
>    X    apropos(1), whatis(1), less(1), groff(1).
>    ^ cursor here.

Thabnks for the footwork.  Please see if the patch below solves the
problem.

2000-10-09  Eli Zaretskii  <address@hidden>

        * info/session.c (info_menu_or_ref_item): If point is before all
        the cross-references, use the first one as the default, instead of
        setting which to -1 and crashing.

--- info/session.c~2    Wed Aug 23 19:18:54 2000
+++ info/session.c      Mon Oct  9 15:22:48 2000
@@ -2056,10 +2056,13 @@ info_menu_or_ref_item (window, count, ke
                             break;
                           }
                       }
-                    if (closest == -1)
-                      which--;
-                    else
-                      which = closest;
+                   if (which > 0)
+                     {
+                       if (closest == -1)
+                         which--;
+                       else
+                         which = closest;
+                     }
                   }
 
                 defentry = (REFERENCE *)xmalloc (sizeof (REFERENCE));



reply via email to

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