summaryrefslogtreecommitdiff
path: root/usr.bin/printf
AgeCommit message (Collapse)Author
2024-07-15Remove residual blank line at start of MakefileWarner Losh
This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
2023-11-26Remove copyright strings ifdef'd outWarner Losh
We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
2023-11-26usr.bin: Remove ancient SCCS tags.Warner Losh
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
2023-09-25Purge more stray embedded $FreeBSD$ stringsJohn Baldwin
These do not use __FBSDID but instead use bare char arrays. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41957
2023-08-16Remove $FreeBSD$: one-line nroff patternWarner Losh
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16Remove $FreeBSD$: one-line sh patternWarner Losh
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-04-18Update/fix Makefile.depend for userlandSimon J. Gerraty
2020-07-01printf(1): Add EXAMPLES sectionFernando ApesteguĂ­a
* Small addition with four simple examples * While here, remove three obsolete .Tn macros Approved by: manpages (gbe) Differential Revision: https://reviews.freebsd.org/D25462 Notes: svn path=/head/; revision=362843
2019-07-29printf(1): Note that \c only works in %b stringsJilles Tjoelker
PR: 238313 Reported by: Andras Farkas MFC after: 1 week Notes: svn path=/head/; revision=350425
2018-08-13printf: Add test for width and precision in %b formatJilles Tjoelker
PR: 229641 Submitted by: pfg Notes: svn path=/head/; revision=337728
2018-08-11printf: Fix \c in %b in printf builtin exiting the shell after r337458Jilles Tjoelker
SVN r337458 erroneously partially reverted r265885. This is immediately visible when running the Kyua/ATF tests for usr.bin/printf, which actually test sh's printf builtin. PR: 229641 Notes: svn path=/head/; revision=337618
2018-08-08Fix printf(1) ignores width and precision in %b format.Pedro F. Giffuni
The precision with the conversion specifier b is specified by POSIX: see point 7 in the reference documentation. This corrects previous wrong log in r337440. Reference: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html PR: 229641 Reported by: Rudolf Cejka Submitted by: Garrett D'Amore (illumos) MFC after: 1 week Notes: svn path=/head/; revision=337458
2018-08-08Revert r337440: the log message is wrong.Pedro F. Giffuni
Notes: svn path=/head/; revision=337457
2018-08-07Fix printf(1) ignores width and precision in %b format.Pedro F. Giffuni
The precision with behavior is "unspecified" by POSIX (as of 2018), but most implementations seem to have taken it to be treated the same as for "s"; applied after the unescaping. Adopt the same treatment on our printf. PR: 229641 Submitted by: Garrett D'Amore (illumos) Notes: svn path=/head/; revision=337440
2017-11-20General further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
2017-10-31DIRDEPS_BUILD: Update dependencies.Bryan Drewery
Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
2017-08-02Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper
`SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
2017-08-02Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper
directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Notes: svn path=/head/; revision=321912
2017-04-29printf: Output formatted data directly, instead of via asprintf.Jilles Tjoelker
Long ago, sh used to have its own optimized and restricted string formatting implementation, which the printf builtin had to bypass via asprintf() to a temporary buffer. Since sh has used libc's string formatting implementation for a long time, remove the workaround. Add a check to keep printf %c '' working the same way (output nothing); POSIX allows both outputting nothing and outputting a NUL byte. Also, this change avoids silently discarding format directives for whose output asprintf() cannot allocate memory. Notes: svn path=/head/; revision=317598
2017-02-28Renumber copyright clause 4Warner Losh
Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
2016-05-04Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper
after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299094
2016-03-10MFHGlen Barber
Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
2016-03-09DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery
Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
2016-02-02First pass to fix the 'tests' packages.Glen Barber
Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295171
2015-10-12Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andEnji Cooper
netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison Notes: svn path=/head/; revision=289172
2015-06-13Add META_MODE support.Simon J. Gerraty
Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
2015-06-08dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=284172
2015-05-27Merge sync of headSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=283595
2015-03-01sh: Fix compiler warnings related to duplicate or missing declarations.Jilles Tjoelker
Notes: svn path=/head/; revision=279503
2014-08-19Merge head from 7/28Simon J. Gerraty
Notes: svn path=/projects/bmake/; revision=270164
2014-06-01printf: Install tests/regress.missingpos1.out, fixing tests.Jilles Tjoelker
Notes: svn path=/head/; revision=266948
2014-05-31Fix m2 regression test.Pedro F. Giffuni
This is not really a good test as the behaviour for /c is unspecified. For the record, ksh93 returns: $ printf "abc\n\cdef" abc ef$ Discussed with: Garret D'Amore (Illumos) Notes: svn path=/head/; revision=266912
2014-05-29Update number of tests.Pedro F. Giffuni
Suggested by: jmmv Notes: svn path=/head/; revision=266854
2014-05-29Minor style knit.Pedro F. Giffuni
Notes: svn path=/head/; revision=266853
2014-05-26printf(1): add tests for warn about incomplete uses n$Pedro F. Giffuni
Submitted by: jilles MFC after: 2 weeks Notes: svn path=/head/; revision=266691
2014-05-26printf(1): warn about incomplete uses n$Pedro F. Giffuni
Reviewed by: jilles Obtained from: Illumos MFC after: 2 weeks Notes: svn path=/head/; revision=266690
2014-05-16Updated dependenciesSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=266219
2014-05-13printf: Fix missing arguments for %u/%o/%x/%X after r265592.Jilles Tjoelker
If a numeric argument is missing, zero should be assumed, for signed as well as unsigned conversions. This fixes the 'zero' regression tests. r265592 erroneously reverted r244407. Notes: svn path=/head/; revision=265977
2014-05-11printf: fix regression after illumos merges.Pedro F. Giffuni
The "bltin/bltin.h" wrappers do not support exit() and attempting to call it will exit sh completely. Note that errx() is acceptable but will always return with status 2. Reported by: jilles (and the testing framework) Fix by: jilles Pointyhat: pfg Notes: svn path=/head/; revision=265885
2014-05-10prinf: replace use of alloca with variable length array.Pedro F. Giffuni
Use of alloca(3) is discouraged in FreeBSD. Using a VLA is simple and should be more portable. Requested by: jilles Notes: svn path=/head/; revision=265860
2014-05-10Updated dependenciesSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=265802
2014-05-08Merge from headSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=265720
2014-05-08Fix the incorrect handling of %b and \c in printf(1)Pedro F. Giffuni
This is required for POSIX compliance. Obtained from: Garrett D'Amore (Illumos) MFC after: 4 days Notes: svn path=/head/; revision=265706
2014-05-07Add width and precision specifiers to printf(1) %n$.Pedro F. Giffuni
This actually completes r264743 so that width and precision specifiers work properly with %n$. These keeps consistency with ksh93 and zsh. Requested by: jilles Obtained from: Garrett D'Amore (Illumos) MFC after: 4 days Notes: svn path=/head/; revision=265592
2014-05-06Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh
from the latter. Notes: svn path=/head/; revision=265420
2014-04-28Merge headSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=265044
2014-04-21Add parameterized position handling to printf(1).Pedro F. Giffuni
Add a new %n$ option to change the order of the parameters as done in the ksh93 builtin printf (among others). For example: %printf '%2$1d %1$s\n' one 2 three 4 2 one 4 three The feature was written by Garret D'Amore under a BSD license for Nexenta/illumos. Reference: http://garrett.damore.org/2010/10/new-implementation-of-printf.html PR: bin/152934 Obtained from: Illumos MFC after: 2 weeks Notes: svn path=/head/; revision=264743
2014-04-17Minor style(9) cleanupsPedro F. Giffuni
#define should be followed by a tab. MFC after: 3 days Notes: svn path=/head/; revision=264581
2014-03-16Migrate most of tools/regression/usr.bin/ to the new tests layout.Julio Merino
I'm starting with the easy cases. The leftovers need to be looked at a bit more closely. Note that this change _does_ modify the code of the old tests. This is required in order to allow the code to locate the data files in the source directory instead of the current directory, because Kyua automatically changes the latter to a temporary directory. Also note that at least one test is known to be broken here. Actually, the test is not really broken: it's marked as a TODO but unfortunately Kyua's TAP parser currently does not understand that. Will have to be fixed separately. Notes: svn path=/head/; revision=263227
2013-03-11Updated dependenciesSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=248169