svn commit: r245418 - head/usr.bin/stdbuf
Jeremie Le Hen
jlh at FreeBSD.org
Mon Jan 14 11:03:14 UTC 2013
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",
More information about the svn-src-all
mailing list