texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * info/man.c (check_manpage_node): Call get_manpa


From: Gavin D. Smith
Subject: branch master updated: * info/man.c (check_manpage_node): Call get_manpage_node if exit status from man -w PAGE was 2.
Date: Tue, 18 Oct 2022 06:32:04 -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 ef2eb35898 * info/man.c (check_manpage_node): Call get_manpage_node if 
exit status from man -w PAGE was 2.
ef2eb35898 is described below

commit ef2eb3589883dc6ced661e424f0e11bee05cc83b
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Oct 18 11:31:53 2022 +0100

    * info/man.c (check_manpage_node):
    Call get_manpage_node if exit status from man -w PAGE was 2.
---
 ChangeLog  |  5 +++++
 info/man.c | 17 ++++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 20edbe9dba..15b50b4fee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-10-18  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * info/man.c (check_manpage_node):
+       Call get_manpage_node if exit status from man -w PAGE was 2.
+
 2022-10-17  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * doc/texinfo.texi (@quotation): Do not state that
diff --git a/info/man.c b/info/man.c
index 37df94c3a0..841e285324 100644
--- a/info/man.c
+++ b/info/man.c
@@ -73,7 +73,8 @@ check_manpage_node (char *pagename)
 {
   char *cmd;
   pid_t child;
-  int pid_status;
+  int pid_status = 0;
+  NODE *man_node;
 
   child = fork ();
   if (child == -1)
@@ -89,14 +90,24 @@ check_manpage_node (char *pagename)
       if (!formatter)
         exit (1);
       ret = execl (formatter, formatter, "-w", pagename, (void *) 0);
-      exit (1); /* exec failed */
+      exit (2); /* exec failed */
     }
   else
     {
       wait (&pid_status);
     }
 
-  return !pid_status;
+  if (pid_status != 2)
+    return !pid_status;
+
+  /* Possibly "man -w" wasn't recognized. */
+  man_node = get_manpage_node (pagename);
+  if (man_node)
+    {
+      free (man_node);
+      return 1;
+    }
+  return 0;
 }
 
 #else /* !PIPE_USE_FORK */



reply via email to

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