[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * info/nodes.c (info_create_node): use consistent
From: |
Patrice Dumas |
Subject: |
branch master updated: * info/nodes.c (info_create_node): use consistent type. |
Date: |
Wed, 09 Oct 2024 06:45:16 -0400 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new f037f69782 * info/nodes.c (info_create_node): use consistent type.
f037f69782 is described below
commit f037f6978271e9fca86704e053720dd9211d6d9a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Oct 9 12:45:07 2024 +0200
* info/nodes.c (info_create_node): use consistent type.
* info/nodes.c (info_node_of_tag_ext): remove cast of node->nodelen to
unsigned long, it is not useful, node->nodelen should be positive at
this point, and could be dangerous, as node->display_pos is long.
* info/nodes.c (info_node_of_tag_ext): always reset node->display_pos
to zero if negative. It should not happen, but it is always safer.
---
ChangeLog | 11 +++++++++++
info/nodes.c | 7 ++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index de9cbe1f6a..d04a368a2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-10-09 Patrice Dumas <pertusus@free.fr>
+
+ * info/nodes.c (info_create_node): use consistent type.
+
+ * info/nodes.c (info_node_of_tag_ext): remove cast of node->nodelen to
+ unsigned long, it is not useful, node->nodelen should be positive at
+ this point, and could be dangerous, as node->display_pos is long.
+
+ * info/nodes.c (info_node_of_tag_ext): always reset node->display_pos
+ to zero if negative. It should not happen, but it is always safer.
+
2024-10-09 Patrice Dumas <pertusus@free.fr>
* info/echo-area.c (remove_completion_duplicates, build_completions):
diff --git a/info/nodes.c b/info/nodes.c
index 9fdaeee3c1..380a1403b6 100644
--- a/info/nodes.c
+++ b/info/nodes.c
@@ -917,7 +917,7 @@ info_create_node (void)
static size_t
get_node_length (SEARCH_BINDING *binding)
{
- size_t i;
+ long i;
char *body;
/* [A node] ends with either a ^_, a ^L, or end of file. */
@@ -1345,9 +1345,10 @@ info_node_of_tag_ext (FILE_BUFFER *fb, TAG **tag_ptr,
int fast)
/* Otherwise an anchor at the end of a node ends up displaying at
the end of the last line of the node (way over on the right of
the screen), which looks wrong. */
- if (node->display_pos >= (unsigned long) node->nodelen)
+ if (node->display_pos >= node->nodelen)
node->display_pos = node->nodelen - 1;
- else if (node->display_pos < 0)
+
+ if (node->display_pos < 0)
node->display_pos = 0; /* Shouldn't happen. */
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * info/nodes.c (info_create_node): use consistent type.,
Patrice Dumas <=