From b4a728878fe28ce0ecb604b197c46ef904825d4e Mon Sep 17 00:00:00 2001 From: jilles Date: Sun, 24 Jul 2011 17:24:26 +0000 Subject: [PATCH] MFC r212374,r221026: printf(1): Document need for "--" before format strings starting with "-". Also move the remark that hexadecimal escapes are not provided to the new CAVEATS section. PR: 158846 git-svn-id: svn://svn.freebsd.org/base/stable/8@224289 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.bin/printf/printf.1 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/usr.bin/printf/printf.1 b/usr.bin/printf/printf.1 index f0fc00b63..f03abc0c9 100644 --- a/usr.bin/printf/printf.1 +++ b/usr.bin/printf/printf.1 @@ -332,6 +332,16 @@ command appeared in It is modeled after the standard library function, .Xr printf 3 . +.Sh CAVEATS +.Tn ANSI +hexadecimal character constants were deliberately not provided. +.Pp +Trying to print a dash ("-") as the first character causes +.Nm +to interpret the dash as a program argument. +.Nm -- +must be used before +.Ar format . .Sh BUGS Since the floating point numbers are translated from .Tn ASCII @@ -343,9 +353,6 @@ The .Cm L modifier may produce additional precision, depending on the hardware platform.) .Pp -.Tn ANSI -hexadecimal character constants were deliberately not provided. -.Pp The escape sequence \e000 is the string terminator. When present in the argument for the .Cm b -- 2.45.0