Source-Changes-HG archive

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

[src/trunk]: src/bin/pax pax: exit 0 if stdin filelist is used and empty



details:   https://anonhg.NetBSD.org/src/rev/7afeef74106a
branches:  trunk
changeset: 376055:7afeef74106a
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun May 28 17:01:46 2023 +0000

description:
pax: exit 0 if stdin filelist is used and empty

If copying a list of files from stdin, exit zero instead of non-zero
if there are no files supplied.

AFAICT, POSIX doesn't require a non-zero an error in this situation,
since there are no files to not match.

Fix from PR bin/41736 by Lloyd Parkes.

diffstat:

 bin/pax/ftree.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 5cf5ed637927 -r 7afeef74106a bin/pax/ftree.c
--- a/bin/pax/ftree.c   Sun May 28 12:56:56 2023 +0000
+++ b/bin/pax/ftree.c   Sun May 28 17:01:46 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftree.c,v 1.42 2012/09/27 00:44:59 christos Exp $      */
+/*     $NetBSD: ftree.c,v 1.43 2023/05/28 17:01:46 lukem Exp $ */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = "@(#)ftree.c    8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: ftree.c,v 1.42 2012/09/27 00:44:59 christos Exp $");
+__RCSID("$NetBSD: ftree.c,v 1.43 2023/05/28 17:01:46 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -194,7 +194,7 @@ ftree_start(void)
        }
 
        if (ftree_arg() < 0)
-               return -1;
+               return 0;
        if (tflag && (atdir_start() < 0))
                return -1;
        return 0;



Home | Main Index | Thread Index | Old Index