Date: Mon, 14 Jan 2013 11:03:13 +0000 (UTC) From: Jeremie Le Hen <jlh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245418 - head/usr.bin/stdbuf Message-ID: <201301141103.r0EB3DBN046987@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jlh Date: Mon Jan 14 11:03:13 2013 New Revision: 245418 URL: http://svnweb.freebsd.org/changeset/base/245418 Log: 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) Modified: head/usr.bin/stdbuf/stdbuf.c Modified: head/usr.bin/stdbuf/stdbuf.c ============================================================================== --- head/usr.bin/stdbuf/stdbuf.c Mon Jan 14 11:00:06 2013 (r245417) +++ head/usr.bin/stdbuf/stdbuf.c Mon Jan 14 11:03:13 2013 (r245418) @@ -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",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301141103.r0EB3DBN046987>