summaryrefslogtreecommitdiff
path: root/usr.bin/paste
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2018-01-02 06:56:42 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2018-01-02 06:56:42 +0000
commit78020b705ad89524fca2071274866c932c8973d8 (patch)
treec4918feaf8132ddd326807ae772ad3f0bc233751 /usr.bin/paste
parentfebc602080426adfdd724bb2744d0acc1ed1701e (diff)
When invoked with no file arguments, display usage and fail instead of
silently doing nothing. suggested by Klemens Nanni (kl3 (at) posteo.org), from FreeBSD r92772 ok millert@
Diffstat (limited to 'usr.bin/paste')
-rw-r--r--usr.bin/paste/paste.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/paste/paste.c b/usr.bin/paste/paste.c
index 4b00413e5bb..fd51bfa0a4c 100644
--- a/usr.bin/paste/paste.c
+++ b/usr.bin/paste/paste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: paste.c,v 1.22 2015/12/09 19:39:10 mmcc Exp $ */
+/* $OpenBSD: paste.c,v 1.23 2018/01/02 06:56:41 guenther Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -77,6 +77,9 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
+ if (argc == 0)
+ usage();
+
if (!delim) {
delimcnt = 1;
delim = "\t";