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.
section.
* Document the `-l`, `-M` and `-S` options.
* Improve the text describing the behavior of the `-r` option.
* Start a section on standard compliance.
* Indicate in the synopsis that the `-S` and `-s` options are mutually
exclusive.
Obtained from: elftoolchain
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.
"Use strlcpy, not strncpy, when the desired semantics are strlcpy's
rather than strncpy's."
Note: NetBSD's 1.32 is their adoption of our r216206
Obtained from: dholland@NetBSD.org
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.
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.
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.
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
Also add $FreeBSD$ to a few files to keep svn happy.
Discussed with: imp, rwatson
"synchronize synopsis and usage; "-l", "-r", "-s" and "-x" are mutually
exclusive; while here, slightly improve spacing in the source code
so it fits on a 80-column display again.
diff greatly improved by martynas@"
Obtained from: sobrado@OpenBSD.org
The #define BUILTIN was for building as a csh (not tcsh) builtin.
Given that csh was replaced by tcsh years ago there is no point in keeping
this.
The #define SHELL is for building as an sh builtin and is in active use.
This commit does not change the /bin/sh and /usr/bin/printf binaries.
1.21
"Document the flags displayed by the default format, and mention their short
names. From espie@openbsd via jmc@openbsd."
1.24
"Fix three variable names.
From Todd T. Fries via Jason McIntyre."
Obtained from: wiz@NetBSD.org (previous 2)
1.25
"Be consistent: document the birthtime field of struct stat for
the "B" field specifier."
Obtained from: reed@NetBSD.org
1.26
"Drop trailing space."
Obtained from: wiz@NetBSD.org
1.27
"Since we have st_birthtime in struct stat, it is in default display."
Obtained from: enami@NetBSD.org
Purposely skipping the following revisions:
1.22 NetBSD-specific change
1.23 Removal of license clauses 3 and 4, already handled by imp
in our r203971
"Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)"
Because of code differences I had to hand-apply parts of the patch,
so responsibility for errors goes to me.
Obtained from: lukem@NetBSD.org
"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)
Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"
Obtained from: elad@NetBSD.org
of the target, similar to realpath(1). See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=34662
This brings in the following changes:
1.24
"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)
Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"
Obtained from: elad@NetBSD.org
1.25
"Fix a segfault when doing 'stat -f %R' on the stdin file handle, instead
fake the filename '(stdin)' like the %N format."
Obtained from: mlelstv@NetBSD.org
1.27
"The ofmt variable is actually a bit mask (not the character that was
in the format string) so that we can "or" it with the bits in the
formats variable. This fixes the missing " -> " in front of the real
path (when you use %SR).
Also, the ?: needs another space."
Obtained from: atatat@NetBSD.org
I am purposely omitting the following changes:
1.23 A humanize_number(3) clone that should better be implemented by
actually using humanize_number(3)
1.26 This is the removal of license clause 3 and 4, already handled
by imp in r203971
"Fix a trivial truncation case, and eliminate a corner case that might
print a nul character."
I am purposely bypassing the following versions:
1.19 A build infrastructure change that does not apply to us
1.20 A feature I am not interested in, but don't object if someone else
wants to pick it up
1.21 A build infrastructure change that does not apply to us
Obtained from: atatat@NetBSD.org
"If using stat (the -L flag) and it fails, fall back to lstat(). It
may be the case that we're examining a broken symlink, and anything is
better than nothing."
The changes in 1.14 through 1.17 were not relevant to us.
Obtained from: atatat@NetBSD.org