From dee6f001b88c7c7b6331691156c838b0a41e775b Mon Sep 17 00:00:00 2001 From: Jeremie Le Hen Date: Mon, 14 Jan 2013 11:03:13 +0000 Subject: [PATCH] Allow commands without any additional arguments, as stated in the manpage. While here, exit early when there is nothing to do. PR: 168415 Submitted by: Zhihao Yuan (initial version) MFC after: 1 week Approved by: kib (mentor) --- usr.bin/stdbuf/stdbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/stdbuf/stdbuf.c b/usr.bin/stdbuf/stdbuf.c index 3831b5e3ba66..639de951400c 100644 --- a/usr.bin/stdbuf/stdbuf.c +++ b/usr.bin/stdbuf/stdbuf.c @@ -72,8 +72,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (argc < 2) - usage(0); + if (argc == 0) + exit(0); if (ibuf != NULL && setenv("_STDBUF_I", ibuf, 1) == -1) warn("Failed to set environment variable: %s=%s",