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.
This commit is contained in:
lukem 2023-05-28 17:01:46 +00:00
parent 67743dc0d8
commit 81f726b0e0
1 changed files with 3 additions and 3 deletions

View File

@ -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;