From owner-cvs-src-old@FreeBSD.ORG Tue Dec 14 01:17:13 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBA1310657D8 for ; Tue, 14 Dec 2010 01:17:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8E4398FC0C for ; Tue, 14 Dec 2010 01:17:13 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id oBE1HD7T090496 for ; Tue, 14 Dec 2010 01:17:13 GMT (envelope-from delphij@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id oBE1HDP3090495 for cvs-src-old@freebsd.org; Tue, 14 Dec 2010 01:17:13 GMT (envelope-from delphij@repoman.freebsd.org) Message-Id: <201012140117.oBE1HDP3090495@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to delphij@repoman.freebsd.org using -f From: Xin LI Date: Tue, 14 Dec 2010 01:16:56 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/usr.bin/printf printf.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 01:17:14 -0000 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