[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * info/display.c (display_update_node_text), info
From: |
Patrice Dumas |
Subject: |
branch master updated: * info/display.c (display_update_node_text), info/session.c (looking_at_newline, looking_at_alnum): check mbi_avail return value. The caller probably makes sure that there are bytes, but this should be more robust and could still be relevant for invalid multibytes sequences depending on mbi_avail implementation. |
Date: |
Fri, 11 Oct 2024 03:25: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 1e532970ea * info/display.c (display_update_node_text), info/session.c
(looking_at_newline, looking_at_alnum): check mbi_avail return value. The
caller probably makes sure that there are bytes, but this should be more robust
and could still be relevant for invalid multibytes sequences depending on
mbi_avail implementation.
1e532970ea is described below
commit 1e532970ea8436cd0b4af30308a146d18c80c423
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Oct 11 09:25:02 2024 +0200
* info/display.c (display_update_node_text), info/session.c
(looking_at_newline, looking_at_alnum): check mbi_avail return value.
The caller probably makes sure that there are bytes, but this should
be more robust and could still be relevant for invalid multibytes
sequences depending on mbi_avail implementation.
---
ChangeLog | 8 ++++++++
info/display.c | 5 ++++-
info/session.c | 9 +++++++--
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4c9749c92c..0886f110bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-11-10 Patrice Dumas <pertusus@free.fr>
+
+ * info/display.c (display_update_node_text), info/session.c
+ (looking_at_newline, looking_at_alnum): check mbi_avail return value.
+ The caller probably makes sure that there are bytes, but this should
+ be more robust and could still be relevant for invalid multibytes
+ sequences depending on mbi_avail implementation.
+
2024-10-10 Patrice Dumas <pertusus@free.fr>
* nfo/terminal.c (keys, keys2), info/variables.c (styles),
diff --git a/info/display.c b/info/display.c
index b6e0f6f15c..4db4a1d665 100644
--- a/info/display.c
+++ b/info/display.c
@@ -513,7 +513,10 @@ display_update_node_text (WINDOW *win)
mbi_init (iter, win->node->contents + win->line_starts[win->pagetop],
win->node->nodelen - win->line_starts[win->pagetop]);
- mbi_avail (iter);
+
+ if (!mbi_avail (iter))
+ return 0;
+
while (1)
{
int delim, text_buffer_line_offset;
diff --git a/info/session.c b/info/session.c
index 7bd5eeaa7e..e6529f6d0d 100644
--- a/info/session.c
+++ b/info/session.c
@@ -1121,7 +1121,10 @@ looking_at_newline (WINDOW *win, long point)
mbi_iterator_t iter;
mbi_init (iter, win->node->contents + point,
win->node->nodelen - point);
- mbi_avail (iter);
+
+ if (!mbi_avail (iter))
+ return 0;
+
return mbi_cur (iter).wc_valid && mbi_cur (iter).wc == '\n';
}
@@ -1132,7 +1135,9 @@ looking_at_alnum (WINDOW *win)
mbi_iterator_t iter;
mbi_init (iter, win->node->contents + win->point,
win->node->nodelen - win->point);
- mbi_avail (iter);
+
+ if (!mbi_avail (iter))
+ return 0;
return mbi_cur (iter).wc_valid && iswalnum (mbi_cur (iter).wc);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * info/display.c (display_update_node_text), info/session.c (looking_at_newline, looking_at_alnum): check mbi_avail return value. The caller probably makes sure that there are bytes, but this should be more robust and could still be relevant for invalid multibytes sequences depending on mbi_avail implementation.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * nfo/terminal.c (keys, keys2), info/variables.c (styles), tp/Texinfo/XS/main/utils.c (def_aliases, default_expanded_formats), tp/Texinfo/XS/parsetexi/end_line.c (end_line_misc_line), tp/Texinfo/XS/parsetexi/indices.c (default_indices) (def_command_indices), tp/Texinfo/XS/parsetexi/def.c (def_maps): add braces for each structure in arrays initialization.
- Next by Date:
branch master updated: * tp/Texinfo/XS/parsetexi/macro.c (parse_macro_command_line): remove variable set but unused.
- Previous by thread:
branch master updated: * nfo/terminal.c (keys, keys2), info/variables.c (styles), tp/Texinfo/XS/main/utils.c (def_aliases, default_expanded_formats), tp/Texinfo/XS/parsetexi/end_line.c (end_line_misc_line), tp/Texinfo/XS/parsetexi/indices.c (default_indices) (def_command_indices), tp/Texinfo/XS/parsetexi/def.c (def_maps): add braces for each structure in arrays initialization.
- Next by thread:
branch master updated: * tp/Texinfo/XS/parsetexi/macro.c (parse_macro_command_line): remove variable set but unused.
- Index(es):