texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Avoid info crash for Brazillian Portuguese


From: Gavin D. Smith
Subject: branch master updated: Avoid info crash for Brazillian Portuguese
Date: Sat, 24 Jul 2021 11:15:14 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 04f7ed5  Avoid info crash for Brazillian Portuguese
04f7ed5 is described below

commit 04f7ed5ce647050f28106b589217fb2509626d38
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Jul 24 16:13:44 2021 +0100

    Avoid info crash for Brazillian Portuguese
    
    * info/infodoc.c (replace_in_documentation): Do not abort
    if command name is not found in documentation.  As the string
    may have come from a translated message, such a problem may
    not be found for some time.  Report from
    René Neumann <lists@necoro.eu>.
---
 ChangeLog      | 10 ++++++++++
 info/infodoc.c | 22 ++++++++++++++--------
 2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 654b845..c72c9c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2021-07-24  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       Avoid info crash for Brazillian Portuguese
+
+       * info/infodoc.c (replace_in_documentation): Do not abort
+       if command name is not found in documentation.  As the string
+       may have come from a translated message, such a problem may
+       not be found for some time.  Report from
+       René Neumann <lists@necoro.eu>.
+
 2021-07-12  Eli Zaretskii  <eliz@gnu.org>
 
        * tp/Texinfo/XS/parsetexi/handle_commands.c
diff --git a/info/infodoc.c b/info/infodoc.c
index b9cb00d..640fd06 100644
--- a/info/infodoc.c
+++ b/info/infodoc.c
@@ -713,18 +713,24 @@ replace_in_documentation (const char *string, int 
help_is_only_window_p)
 
               /* Find a key which invokes this function in the info_keymap. */
               command = named_function (fun_name);
-              free (rep_name);
 
               /* If the internal documentation string fails, there is a
-                 serious problem with the associated command's documentation.
-                 We croak so that it can be fixed immediately. */
+                 problem with the associated command's documentation (probably
+                 in the translation). */
               if (!command)
-                abort ();
-
-              rep = where_is (info_keymap, command);
-              if (!rep)
-                rep = "N/A";
+                {
+                  info_error ("bug: no command <%s>\n", rep_name);
+                  sleep (1);
+                  rep = "BUG";
+                }
+              else
+                {
+                  rep = where_is (info_keymap, command);
+                  if (!rep)
+                    rep = "N/A";
+                }
               replen = strlen (rep);
+              free (rep_name);
 
               if (fmt)
                 text_buffer_printf (&txtresult, fmt, rep);



reply via email to

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