[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/parsetexi/macro.c (handle_macro):
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/parsetexi/macro.c (handle_macro): use strchrnul instead of strchr to have more common code. |
Date: |
Mon, 27 May 2024 15:14:51 -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 eeb1ffe669 * tp/Texinfo/XS/parsetexi/macro.c (handle_macro): use
strchrnul instead of strchr to have more common code.
eeb1ffe669 is described below
commit eeb1ffe6690cf779087b34bb05676ba6cfc23a84
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon May 27 21:14:38 2024 +0200
* tp/Texinfo/XS/parsetexi/macro.c (handle_macro): use strchrnul
instead of strchr to have more common code.
---
ChangeLog | 5 +++++
tp/Texinfo/XS/parsetexi/macro.c | 10 +++-------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 87792a4489..c56c1e3b42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-05-27 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/parsetexi/macro.c (handle_macro): use strchrnul
+ instead of strchr to have more common code.
+
2024-05-27 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ParserNonXS.pm (_abort_empty_line),
diff --git a/tp/Texinfo/XS/parsetexi/macro.c b/tp/Texinfo/XS/parsetexi/macro.c
index bdcf34c0fa..4a530dbc81 100644
--- a/tp/Texinfo/XS/parsetexi/macro.c
+++ b/tp/Texinfo/XS/parsetexi/macro.c
@@ -934,16 +934,12 @@ handle_macro (ELEMENT *current, const char **line_inout,
enum command_id cmd)
}
if (! leading_spaces_added)
{
- char *p = strchr (line, '\n');
+ const char *p = strchrnul (line, '\n');
+ arg_elt = merge_text (arg_elt, line, (p - line), 0);
if (!p)
- {
- size_t line_len = strlen (line);
- arg_elt = merge_text (arg_elt, line, line_len, 0);
- line += line_len;
- }
+ line = p;
else
{
- arg_elt = merge_text (arg_elt, line, (p - line), 0);
line = "\n";
break;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/parsetexi/macro.c (handle_macro): use strchrnul instead of strchr to have more common code.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_abort_empty_line), tp/Texinfo/XS/parsetexi/parser.c (abort_empty_line): different debug message if additional_spaces are added or not.
- Next by Date:
branch master updated: * tp/Texinfo/XS/main/translations.c (replace_substrings), tp/Texinfo/XS/main/utils.c (read_flag_len), tp/Texinfo/XS/parsetexi/end_line.c (end_line_starting_block), tp/Texinfo/XS/parsetexi/handle_commands.c (parse_rawline_command), tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line): replace read_flag_name by read_flag_len that only returns the length of the flag. This allows to check first if there is a matching brace or if there is nothing remaining on the line before allocating [...]
- Previous by thread:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_abort_empty_line), tp/Texinfo/XS/parsetexi/parser.c (abort_empty_line): different debug message if additional_spaces are added or not.
- Next by thread:
branch master updated: * tp/Texinfo/XS/main/translations.c (replace_substrings), tp/Texinfo/XS/main/utils.c (read_flag_len), tp/Texinfo/XS/parsetexi/end_line.c (end_line_starting_block), tp/Texinfo/XS/parsetexi/handle_commands.c (parse_rawline_command), tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line): replace read_flag_name by read_flag_len that only returns the length of the flag. This allows to check first if there is a matching brace or if there is nothing remaining on the line before allocating [...]
- Index(es):