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): Revert to usin


From: Gavin D. Smith
Subject: branch master updated: * info/man.c (check_manpage_node): Revert to using "man -w" instead of "man --where" to work on FreeBSD and macOS. Disable this code if __sun is defined. From Bruno Haible.
Date: Mon, 02 Jan 2023 16:14:42 -0500

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 2484e7ac97 * info/man.c (check_manpage_node): Revert to using "man -w" 
instead of "man --where" to work on FreeBSD and macOS. Disable this code if 
__sun is defined.  From Bruno Haible.
2484e7ac97 is described below

commit 2484e7ac97bc60b951557ee969afb885259cc493
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Jan 2 21:12:27 2023 +0000

    * info/man.c (check_manpage_node): Revert to using "man -w"
    instead of "man --where" to work on FreeBSD and macOS.
    Disable this code if __sun is defined.  From Bruno Haible.
---
 ChangeLog  |  6 ++++++
 info/man.c | 15 +++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b31722ff55..f730d9f201 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-01-02  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * info/man.c (check_manpage_node): Revert to using "man -w"
+       instead of "man --where" to work on FreeBSD and macOS.
+       Disable this code if __sun is defined.  From Bruno Haible.
+
 2023-01-02  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line),
diff --git a/info/man.c b/info/man.c
index 39d011c57f..3db70be80a 100644
--- a/info/man.c
+++ b/info/man.c
@@ -1,6 +1,6 @@
 /* man.c: How to read and format man files.
 
-   Copyright 1995-2022 Free Software Foundation, Inc.
+   Copyright 1995-2023 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -63,14 +63,11 @@ static NODE **manpage_nodes = 0;
 size_t manpage_node_index = 0;
 size_t manpage_node_slots = 0;
 
-#if PIPE_USE_FORK
+#if PIPE_USE_FORK && !defined(__sun)
 
-/* Check if a man page exists.  Use "man --where" for this rather than getting
+/* Check if a man page exists.  Use "man -w" for this rather than getting
    the contents of the man page.  This is faster if we are running
    "info --where" and we don't need the contents.
-
-   NB use man --where instead of man -w as the latter has a different meaning
-   on Solaris (update whatis database). */
 int
 check_manpage_node (char *pagename)
 {
@@ -91,7 +88,7 @@ check_manpage_node (char *pagename)
       formatter = find_man_formatter();
       if (!formatter)
         exit (1);
-      execl (formatter, formatter, "--where", pagename, (void *) 0);
+      execl (formatter, formatter, "-w", pagename, (void *) 0);
       exit (2); /* exec failed */
     }
   else
@@ -112,7 +109,9 @@ check_manpage_node (char *pagename)
   return 0;
 }
 
-#else /* !PIPE_USE_FORK */
+#else /* !PIPE_USE_FORK || defined(__sun) */
+/* We check __sun because 'man -w' has a different meaning on
+   Solaris (update whatis database). */
 
 int
 check_manpage_node (char *pagename)



reply via email to

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