[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[5699] node_printed_rep, M-x menu-sequence
From: |
Gavin D. Smith |
Subject: |
[5699] node_printed_rep, M-x menu-sequence |
Date: |
Sat, 05 Jul 2014 16:26:14 +0000 |
Revision: 5699
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5699
Author: gavin
Date: 2014-07-05 16:26:11 +0000 (Sat, 05 Jul 2014)
Log Message:
-----------
node_printed_rep, M-x menu-sequence
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/session.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2014-07-05 15:53:27 UTC (rev 5698)
+++ trunk/ChangeLog 2014-07-05 16:26:11 UTC (rev 5699)
@@ -1,5 +1,13 @@
2014-07-05 Gavin Smith <address@hidden>
+ * info/session.c (node_printed_rep): Keep pointer to storage to
+ returned string in static pointer to avoid memory leaks by callers.
+ (info_menu_sequence): Don't clear echo area if there was an error
+ message. If a component in the sequence is invalid, go to the last
+ node reached.
+
+2014-07-05 Gavin Smith <address@hidden>
+
* info/nodes.h (NODE): Fields 'parent', 'filename' removed. Fields
'fullpath', 'subfile' added.
(N_Subfile): New symbol.
Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c 2014-07-05 15:53:27 UTC (rev 5698)
+++ trunk/info/session.c 2014-07-05 16:26:11 UTC (rev 5699)
@@ -2758,18 +2758,18 @@
if (!dir_node)
info_error (msg_cant_find_node, "Top");
else
- node = info_follow_menus (dir_node, nodes, &error, 0);
+ {
+ node = info_follow_menus (dir_node, nodes, &error, 0);
+ info_set_node_of_window (window, node);
+ if (error)
+ show_error_node (error);
+ else
+ window_clear_echo_area ();
+ }
free (nodes);
- if (error)
- show_error_node (error);
- else
- info_set_node_of_window (window, node);
}
-
free (line);
- if (!info_error_was_printed)
- window_clear_echo_area ();
}
@@ -2784,18 +2784,17 @@
char *
node_printed_rep (NODE *node)
{
- char *rep;
+ static char *rep;
if (node->fullpath)
{
char *filename = filename_non_directory (node->fullpath);
- rep = xmalloc (1 + strlen (filename) + 1 + strlen (node->nodename) + 1);
+ rep = xrealloc (rep, 1 + strlen (filename) + 1 + strlen (node->nodename)
+ 1);
sprintf (rep, "(%s)%s", filename, node->nodename);
+ return rep;
}
else
- rep = node->nodename;
-
- return rep;
+ return node->nodename;
}
/* Read a line of input which is a node name, and go to that node. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [5699] node_printed_rep, M-x menu-sequence,
Gavin D. Smith <=