texinfo-commits
[Top][All Lists]
Advanced

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

[5786] goal column after search, backward search positioning, error mess


From: Gavin D. Smith
Subject: [5786] goal column after search, backward search positioning, error message memory leak
Date: Tue, 26 Aug 2014 18:56:48 +0000

Revision: 5786
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5786
Author:   gavin
Date:     2014-08-26 18:56:44 +0000 (Tue, 26 Aug 2014)
Log Message:
-----------
goal column after search, backward search positioning, error message memory leak

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-08-26 14:17:33 UTC (rev 5785)
+++ trunk/ChangeLog     2014-08-26 18:56:44 UTC (rev 5786)
@@ -1,5 +1,13 @@
 2014-08-26  Gavin Smith  <address@hidden>
 
+       * info/session.c (info_follow_menus): Free error argument before
+       overwriting it.
+       (info_search_in_node_internal): Set goal column after search.
+       (info_search_previous): Work correctly when the match is an exact
+       number of screen-fulls away.
+
+2014-08-26  Gavin Smith  <address@hidden>
+
        * info/m-x.c (info_execute_command): Free a string.  Allow arbitarily
        long prompts.
        * info/info.c (main): Exit with exit() instead of 'return' to avoid

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-08-26 14:17:33 UTC (rev 5785)
+++ trunk/info/session.c        2014-08-26 18:56:44 UTC (rev 5786)
@@ -2723,9 +2723,6 @@
   WINDOW *defaults;
   NODE *node = NULL;
 
-  if (error)
-    *error = NULL;
-
   for (; *menus; menus++)
     {
       REFERENCE *entry;
@@ -2737,8 +2734,11 @@
       if (!initial_node->references)
         {
           if (error)
-            asprintf (error, _("No menu in node `%s'."),
-                      node_printed_rep (initial_node));
+            {
+              free (*error);
+              asprintf (error, _("No menu in node `%s'."),
+                        node_printed_rep (initial_node));
+            }
           debug (3, ("no menu found"));
           if (!strict)
             return initial_node;
@@ -2756,8 +2756,11 @@
       if (!entry)
         {
           if (error)
-            asprintf (error, _("No menu item `%s' in node `%s'."),
-                      arg, node_printed_rep (initial_node));
+            {
+              free (*error);
+              asprintf (error, _("No menu item `%s' in node `%s'."),
+                        arg, node_printed_rep (initial_node));
+            }
           debug (3, ("no entry found"));
           if (!strict)
             return initial_node;
@@ -2777,10 +2780,13 @@
         {
          debug (3, ("no matching node found"));
          if (error)
-            asprintf (error,
-                      _("Unable to find node referenced by `%s' in `%s'."),
-                     entry->label,
-                     node_printed_rep (initial_node));
+            {
+              free (*error);
+              asprintf (error,
+                        _("Unable to find node referenced by `%s' in `%s'."),
+                        entry->label,
+                        node_printed_rep (initial_node));
+            }
           return strict ? 0 : initial_node;
         }
 
@@ -3619,6 +3625,7 @@
         new_point = matches[match_index].rm_so;
 
       window->point = new_point;
+      window->goal_column = window_get_cursor_column (window);
     }
   return result;
 }
@@ -3990,7 +3997,7 @@
          This means if 'info_search_next' was the last command, we'll
          go back to the same place. */
       new_pagetop = window->pagetop - window->height;
-      new_pagetop -= (window->pagetop - match_line) / window->height
+      new_pagetop -= (window->pagetop - match_line - 1) / window->height
                       * window->height;
 
       if (new_pagetop < 0)




reply via email to

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