<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/printf/printf.c, branch release/9.0.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F9.0.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F9.0.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2011-05-28T11:37:47Z</updated>
<entry>
<title>printf: Allow multibyte characters for '&lt;char&gt; form, avoid negative codes.</title>
<updated>2011-05-28T11:37:47Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2011-05-28T11:37:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=98102dabd3d1f00bb970634a5722be0f7e93078d'/>
<id>urn:sha1:98102dabd3d1f00bb970634a5722be0f7e93078d</id>
<content type='text'>
Examples:
  LC_ALL=en_US.UTF-8 printf '%d\n' $(printf \'\\303\\244)
  LC_ALL=en_US.ISO8859-1 printf '%d\n' $(printf \'\\344)
Both of these should print 228.

Like some other shells, incomplete or invalid multibyte characters yield the
value of the first byte without a warning.

Note that there is no general way to go back from the character code to the
character.
</content>
</entry>
<entry>
<title>printf: Note that this is used both as a normal program and a shell builtin.</title>
<updated>2011-03-01T21:47:06Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2011-03-01T21:47:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=77fae5c16dfa60346072a73b2346f38037d05d3b'/>
<id>urn:sha1:77fae5c16dfa60346072a73b2346f38037d05d3b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>printf: Do not use sh memory functions in sh builtin.</title>
<updated>2010-12-29T21:38:00Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2010-12-29T21:38:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=add265c6ba450d4930722a277cd0bc8ac5b42b25'/>
<id>urn:sha1:add265c6ba450d4930722a277cd0bc8ac5b42b25</id>
<content type='text'>
These functions throw exceptions if they fail, possibly causing memory
leaks. The normal out-of-memory handling suffices. The INTOFF around almost
all of printf prevents memory leaks due to SIGINT.
</content>
</entry>
<entry>
<title>sh: Make warnings in the printf builtin non-fatal, like in the program.</title>
<updated>2010-12-20T23:06:57Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2010-12-20T23:06:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6a6760db7f0ba4588af5cb587f482a49d65d1536'/>
<id>urn:sha1:6a6760db7f0ba4588af5cb587f482a49d65d1536</id>
<content type='text'>
The #define for warnx now behaves much like the libc function (except that
it uses sh command name and output).

Also, it now uses C99 __VA_ARGS__ so there is no need for three different
macros for 0, 1 or 2 parameters.
</content>
</entry>
<entry>
<title>Revert r216423 per request from Jilles.</title>
<updated>2010-12-14T20:35:08Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2010-12-14T20:35:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=de46de4dd1362165e9bf9c0d2a50cca7f45044b4'/>
<id>urn:sha1:de46de4dd1362165e9bf9c0d2a50cca7f45044b4</id>
<content type='text'>
The new behavior prevents us from being able to bail out explicitly
on unknown options that we have not implemented.  BASH for instance
have introduced a '-v' for printf(1) builtin and it seems to be bad
to pretend that we supported it and have a script break silently.
</content>
</entry>
<entry>
<title>When printf is being used as a sh(1) builtin, it can not call</title>
<updated>2010-12-14T18:23:15Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2010-12-14T18:23:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5eccc0009b39ee0ef76e13e6606fa5ea4e11a3a9'/>
<id>urn:sha1:5eccc0009b39ee0ef76e13e6606fa5ea4e11a3a9</id>
<content type='text'>
exit(3) as pointed out by jilles@ so revert to using return(),
also change the return value back to 1 as requested by bde@.

This is logically a revert of revision 216422.
</content>
</entry>
<entry>
<title>We work on ctype's and not only on numbers so set LC_ALL instead of</title>
<updated>2010-12-14T01:28:33Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2010-12-14T01:28:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=69be0c5ea2b6ad70935c3654873f5b99f311a859'/>
<id>urn:sha1:69be0c5ea2b6ad70935c3654873f5b99f311a859</id>
<content type='text'>
LC_NUMERIC.

PR:		bin/152934
Submitted by:	Pedro F. Giffuni &lt;giffunip tutopia.com&gt;
Obtained from:	Illumos
</content>
</entry>
<entry>
<title>IEEE Std 1003.1-2008, Section 1.4, Utility Description Defaults says</title>
<updated>2010-12-14T01:16:56Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2010-12-14T01:16:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=02a4a3f56c6722998e251e107ec1bd7c1aa432f3'/>
<id>urn:sha1:02a4a3f56c6722998e251e107ec1bd7c1aa432f3</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Make use of EX_USAGE for usage().</title>
<updated>2010-12-14T00:21:34Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2010-12-14T00:21:34Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6715165066f1139e80bae62d93b2d7738295e484'/>
<id>urn:sha1:6715165066f1139e80bae62d93b2d7738295e484</id>
<content type='text'>
</content>
</entry>
<entry>
<title>The only caller of mknum() provides a char instead of an int, so make it</title>
<updated>2010-12-13T19:54:42Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2010-12-13T19:54:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9180853b893779730349f44b7052afc5da13e855'/>
<id>urn:sha1:9180853b893779730349f44b7052afc5da13e855</id>
<content type='text'>
match the definition.

PR:		bin/152934
Submitted by:	Pedro F. Giffuni &lt;giffunip tutopia.com&gt;
Obtained from:	Illumos
</content>
</entry>
</feed>
