Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/man Exit successfully after printing the search path...



details:   https://anonhg.NetBSD.org/src/rev/52440f1dfc3a
branches:  trunk
changeset: 1008956:52440f1dfc3a
user:      maya <maya%NetBSD.org@localhost>
date:      Mon Apr 06 19:53:22 2020 +0000

description:
Exit successfully after printing the search path, stop further processing.

Continuing to process had the unintended effect that `man` failed to find
a matching manual page for {EMPTY LIST OF REQUESTED MANUAL PAGES}, and
exited with 1.

Prompted by a fish shell snippet that tried and failed to distinguish between
FreeBSD man (-p takes argument) and NetBSD man (-p no argument) by comparing
`man -p` exit code.

ok riastradh, logix (which also pointed out the manual page SYNOPSIS is
saying man -p should be used this way).

diffstat:

 usr.bin/man/man.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 018746207199 -r 52440f1dfc3a usr.bin/man/man.c
--- a/usr.bin/man/man.c Mon Apr 06 19:52:38 2020 +0000
+++ b/usr.bin/man/man.c Mon Apr 06 19:53:22 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: man.c,v 1.67 2018/06/15 20:16:35 mrg Exp $     */
+/*     $NetBSD: man.c,v 1.68 2020/04/06 19:53:22 maya Exp $    */
 
 /*
  * Copyright (c) 1987, 1993, 1994, 1995
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)man.c      8.17 (Berkeley) 1/31/95";
 #else
-__RCSID("$NetBSD: man.c,v 1.67 2018/06/15 20:16:35 mrg Exp $");
+__RCSID("$NetBSD: man.c,v 1.68 2020/04/06 19:53:22 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -363,8 +363,10 @@
 
        }
 
-       if (m.getpath) 
+       if (m.getpath) {
                printmanpath(&m);
+               exit(cleanup());
+       }
                
        /*
         * now m.mymanpath is complete!



Home | Main Index | Thread Index | Old Index