diff options
author | jlh <jlh@FreeBSD.org> | 2013-01-14 11:03:13 +0000 |
---|---|---|
committer | jlh <jlh@FreeBSD.org> | 2013-01-14 11:03:13 +0000 |
commit | 01884f3818940fa278f35e27df14880ec62f4a76 (patch) | |
tree | df3a7ac6c0aa7f70622799c65a7c48f5b40ccdc7 /usr.bin | |
parent | 6a74c8a7a297857add87176088dd40ffdbbcb13d (diff) | |
download | FreeBSD-src-01884f3818940fa278f35e27df14880ec62f4a76.zip FreeBSD-src-01884f3818940fa278f35e27df14880ec62f4a76.tar.gz |
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)
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/stdbuf/stdbuf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/stdbuf/stdbuf.c b/usr.bin/stdbuf/stdbuf.c index 3831b5e..639de95 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", |