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)
This commit is contained in:
Jeremie Le Hen 2013-01-14 11:03:13 +00:00
parent eb23ab3120
commit dee6f001b8

View File

@ -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",