diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-11-18 15:59:11 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-11-18 15:59:11 +0000 |
commit | 72c5fa8fa8af0e6f4cc03462d05805e5e90988f2 (patch) | |
tree | b315b4e157e64d19f348569fd311da4298293939 /usr.bin/printf | |
parent | 28119ad57a22536240fbdf2e6dbce92005a0e5d1 (diff) |
Fix two documentation bugs:
1. Specifying a precision for the %s format character limits the number
of bytes printed, not the number of characters.
2. Document the intentional POSIX violation of ignoring the locale.
Feedback and OK jmc@, bentley@.
Diffstat (limited to 'usr.bin/printf')
-rw-r--r-- | usr.bin/printf/printf.1 | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.bin/printf/printf.1 b/usr.bin/printf/printf.1 index 0f94c15c97f..c9a5de9221b 100644 --- a/usr.bin/printf/printf.1 +++ b/usr.bin/printf/printf.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: printf.1,v 1.29 2015/02/28 21:51:57 bentley Exp $ +.\" $OpenBSD: printf.1,v 1.30 2016/11/18 15:59:10 schwarze Exp $ .\" .\" Copyright (c) 1989, 1990 The Regents of the University of California. .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" from: @(#)printf.1 5.11 (Berkeley) 7/24/91 .\" -.Dd $Mdocdate: February 28 2015 $ +.Dd $Mdocdate: November 18 2016 $ .Dt PRINTF 1 .Os .Sh NAME @@ -196,7 +196,7 @@ for .Cm e and .Cm f -formats, or the maximum number of characters to be printed +formats, or the maximum number of bytes to be printed from a string; if the digit string is missing, the precision is treated as zero. .It Format: @@ -338,7 +338,7 @@ is printed. .It Cm s Characters from the string .Ar argument -are printed until the end is reached or until the number of characters +are printed until the end is reached or until the number of bytes indicated by the precision specification is reached; however if the precision is 0 or missing, all characters in the string are printed. .It Cm \&% @@ -369,7 +369,12 @@ The .Nm utility is compliant with the .St -p1003.1-2008 -specification. +specification, but in order to produce predictable output +it deliberately ignores the +.Xr locale 1 +and always operates as if +.Ev LC_ALL Ns =C +were set. .Pp The escape sequences \ee and \e' are extensions to that specification. .Sh HISTORY |