Date: Tue, 14 Dec 2010 01:16:56 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/usr.bin/printf printf.c Message-ID: <201012140117.oBE1HDP3090495@repoman.freebsd.org>
index | next in thread | raw e-mail
delphij 2010-12-14 01:16:56 UTC
FreeBSD src repository
Modified files:
usr.bin/printf printf.c
Log:
SVN rev 216423 on 2010-12-14 01:16:56Z by delphij
IEEE Std 1003.1-2008, Section 1.4, Utility Description Defaults says
that when the options section is listed as "None", utility shall
recognize "--" as a first argument to be discarded.
This implementation is largely based on OpenBSD implementation but
we do slightly differently:
a) We skip argv[0] as the first step;
b) We test whether the next argument is "--" and ignore it.
With this change one will get:
%printf
usage: printf format [arguments ...]
%printf -v
-v%printf -- -v
-v%
%printf --
usage: printf format [arguments ...]
Which matches the behavior observed on a Debian system but different
from the Illumos change.
Revision Changes Path
1.45 +10 -10 src/usr.bin/printf/printf.c
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012140117.oBE1HDP3090495>
