aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/hexdump
Commit message (Collapse)AuthorAgeFilesLines
* hexdump(1): Exit gracefully on format strings missing conversionConrad Meyer2019-04-133-3/+33
| | | | | | | | PR: 237263 Submitted by: Bojan Petrovic <bojan_petrovic AT fastmail.fm> Notes: svn path=/head/; revision=346187
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-191-1/+1
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395
* Standardize SPDX tag on files I've addedKyle Evans2018-05-092-1/+3
| | | | Notes: svn path=/head/; revision=333419
* Silence the gcc warning: 'op' may be used uninitialized in this functionLi-Wen Hsu2018-01-201-0/+2
| | | | | | | Approved by: kevans Notes: svn path=/head/; revision=328200
* od(1): Fix mis-patch from r328188Kyle Evans2018-01-201-45/+0
| | | | | | | od_test.sh got duplicated erroneously when it was added in r328188. Dedup. Notes: svn path=/head/; revision=328189
* od(1): Fix wrong output for some corner cases in multibyte locales.Kyle Evans2018-01-205-2/+115
| | | | | | | | | | | | | | Restore the original character to print if we used the look-ahead buffer, but that didn't help -- we either got an illegal sequence or still can't complete. PR: 224552 Submitted by: Yuri Pankov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13963 Notes: svn path=/head/; revision=328188
* hexdump(1): Speed up -s flag on devicesKyle Evans2018-01-051-11/+35
| | | | | | | | | | | | | | | | Using the -s flag on devices is extraordinarily slow due to using fseek(3) a little too conservatively. Address this by using fseek on character/block devices as well, falling back to getchar(3) only if we fail to seek or we're operating on tape drives, where fseek may succeed while not actually being supported. PR: 86485 Submitted by: arundel (originally; modified since then) Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D10939 Notes: svn path=/head/; revision=327567
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-207-5/+19
| | | | | | | | | | | | | | | | | 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
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* DIRDEPS_BUILD: Connect new directories.Bryan Drewery2017-10-311-0/+11
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325187
* hexdump: Remove expected test failures for now succeeding testsKyle Evans2017-10-041-2/+0
| | | | | | | | | | | | | | r323990 fixed the -s flag breakage reported by PR 219173. Mark the corresponding hexdump tests accordingly, since they should now both succeed. PR: 222781 Reported by: ngie Reviewed by: emaste, ngie Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D12590 Notes: svn path=/head/; revision=324286
* Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper2017-08-021-0/+1
| | | | | | | | | `SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
* Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper2017-08-021-3/+1
| | | | | | | | | | | | | | 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
* Add some basic tests for hexdump(1)'s various output flags. FormattingKyle Evans2017-07-1326-0/+297
| | | | | | | | | | | | | | | | | tests are omitted for this initial run as there are still some bugs to work out there. This covers -s flag testing on devices and non-devices that would have caught breakage found in PR 219173 as well as other subtle breakage caused locally. Reviewed by: cem, ngie Approved by: cem (acting co-mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D11279 Notes: svn path=/head/; revision=320930
* hexdump: actually enter capability mode on last fileEd Maste2017-06-131-2/+2
| | | | | | | | | Reviewed by: cem, Kyle Evans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10897 Notes: svn path=/head/; revision=319887
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-05-091-0/+1
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318000
* Renumber copyright clause 4Warner Losh2017-02-289-9/+9
| | | | | | | | | | | | 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
* hexdump(1): First cut capsicumificationConrad Meyer2016-12-162-0/+27
| | | | | | | | | | | | | | | For now, only enter the sandbox for the last file processed (including stdin for zero-argument mode). Sandboxing all inputs will require a little restructuring of the program. Feedback by: emaste@ (earlier versions) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D7915 Notes: svn path=/head/; revision=310143
* hexdump(1): Simplify by using asprintf(3)Pedro F. Giffuni2016-09-191-4/+1
| | | | | | | | | | Instead of strlen() + calloc() + snprintf, just use asprintf(). No functional change. Obtained from: OpenBSD (CVS Rev. 1.22) Notes: svn path=/head/; revision=305990
* Fix a bug that caused nothing to be skipped when skipping exactly theKevin Lo2016-02-141-1/+1
| | | | | | | | | number of bytes present in a regular file was requested. Obtained from: OpenBSD Notes: svn path=/head/; revision=295610
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-1/+1
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-191-3/+3
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | Merge headSimon J. Gerraty2014-04-282-11/+8
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * \ \ sync from headSimon J. Gerraty2013-04-121-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=249429
| * | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | hexdump: Don't use uninitialized struct stat.Jilles Tjoelker2015-04-261-1/+1
| |_|_|/ |/| | | | | | | | | | | Notes: svn path=/head/; revision=282041
* | | | fix spelling of offset since that is what is used in the body...John-Mark Gurney2014-10-301-3/+3
| |_|/ |/| | | | | | | | Notes: svn path=/head/; revision=273844
* | | Constify.Xin LI2014-04-252-6/+6
| | | | | | | | | | | | Notes: svn path=/head/; revision=264910
* | | Simplify the way the end of a singly linked list is followed (for addingChristian Brueffer2014-02-221-5/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | items), so it is more obvious that we aren't going to indirect through a NULL pointer. PR: 144723 Submitted by: Garrett Cooper <yaneurabeya at gmail.com> Obtained from: NetBSD r1.19 MFC after: 2 weeks Notes: svn path=/head/; revision=262333
* | Fix typo ('1' != 'l')Eitan Adler2013-03-041-1/+1
|/ | | | | | | | | PR: bin/175975 Submitted by: William Ahern <william@25thandclement.com> Approved by: cperciva (mentor) Notes: svn path=/head/; revision=247753
* mdoc: fix column names, indentation, column separation within each row, andJoel Dahl2012-04-072-8/+8
| | | | | | | | | | quotation. Also make sure we have the same amount of columns in each row as the number of columns we specify in the head arguments. Reviewed by: brueffer Notes: svn path=/head/; revision=233992
* mdoc: terminate quoted strings.Joel Dahl2012-03-261-14/+14
| | | | | | | Reviewed by: brueffer Notes: svn path=/head/; revision=233510
* Fix decoding of escape sequences in format strings:Tijl Coosemans2012-01-281-13/+6
| | | | | | | | | | | | | | | - Zero-terminate the resulting string by letting the for-loop copy the terminating zero. - Exit the for-loop after handling a backslash at the end of the format string to fix a buffer overrun. - Remove some unnecessary comments and blank lines. [1] Requested by: bde [1] PR: bin/144722 Approved by: kib (mentor) Notes: svn path=/head/; revision=230649
* - Fix how hexdump parses escape stringsEitan Adler2012-01-071-8/+23
| | | | | | | | | | | | | | | | From the NetBSD bug: The way how hexdump(1) parses escape sequences has some bugs. It shows up when an escape sequence is used as the non-last character of a format string. PR: bin/144722 Submitted by: gcooper Approved by: rpaulo Obtained from: NetBSD MFC after: 1 week Notes: svn path=/head/; revision=229794
* Replace index() and rindex() calls with strchr() and strrchr().Ed Schouten2012-01-034-7/+7
| | | | | | | | | | | | | The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls. Notes: svn path=/head/; revision=229403
* Formatting fixes:Glen Barber2011-12-231-7/+7
| | | | | | | | | | | | | | | | | | | hexdump/od.1: - Enclose tabbed content in quotes [1] ar/ar.1: - Enclose tabbed content in quotes [1] rctl/rctl.8: - Enclose tabbed content in quotes [1] - Start a sentence on a newline [2] Reported by: manlint [1], igor [2] MFC after: 1 week X-MFC-after: 9.0-RELEASE Notes: svn path=/head/; revision=228823
* Correct a logic error in usr.bin/hexdump/conv.c, found by clang.Dimitry Andric2011-12-171-2/+2
| | | | | | | | | | | | | | | | | | Whenever the conv_c() function encounters an incomplete multibyte char, it peeks ahead. It also sets p to peekbuf, to indicate it is still processing the incomplete character. However, on the next retry, it compares buf against peekbuf, which always returns false, since both buf and peekbuf are local char arrays, whose addresses are never the same. Fix this by comparing against p instead, which was the intention. Also turn peekbuf into an array of u_char, to prevent conversion warnings. MFC after: 1 week Notes: svn path=/head/; revision=228636
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-119-36/+0
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=216370
* Use same table markup as in hexdump.1Ulrich Spörlein2010-06-111-6/+6
| | | | Notes: svn path=/head/; revision=209035
* mdoc: order prologue macros consistently by Dd/Dt/OsUlrich Spörlein2010-04-141-1/+1
| | | | | | | | | | | Although groff_mdoc(7) gives another impression, this is the ordering most widely used and also required by mdocml/mandoc. Reviewed by: ru Approved by: philip, ed (mentors) Notes: svn path=/head/; revision=206622
* The correct value of DEL is 0x7f, not 0xff. This is purely a documentationGavin Atkinson2010-02-182-4/+4
| | | | | | | | | | | issue - od(1) and hexdump(1) behave as expected. PR: docs/143869 Submitted by: gcooper MFC after: 2 weeks Notes: svn path=/head/; revision=204053
* Build usr.bin/ with WARNS=6 by default.Ed Schouten2010-01-021-1/+0
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386
* Revert most part of 200420 as requested, as more review and polish isXin LI2009-12-132-0/+2
| | | | | | | needed. Notes: svn path=/head/; revision=200462
* Remove unneeded header includes from usr.bin/ except contributed code.Xin LI2009-12-112-2/+0
| | | | | | | Tested with: make universe Notes: svn path=/head/; revision=200420