summaryrefslogtreecommitdiffstats
path: root/text-utils/hexdump.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-4/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-291-2/+2
| | | | | | | | | changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: introduce print_usage_help_options()Ruediger Meier2017-06-271-2/+1Star
| | | | | | | | | | | | Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: cosmetics, remove argument from usage(FILE*)Ruediger Meier2017-06-261-3/+4
| | | | | | | | | | | | | | This patch is trivial and changes nothing, because we were always using usage(stdout) Now all our usage() functions look very similar. If wanted we could auto-generate another big cosmetical patch to remove all the useless "FILE *out" constants and use printf and puts rather than their f* friends. Such patch could be automatically synchronized with the translation project (newlines!) to not make the translators sick. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: remove superfluous null pointer checks for optargRuediger Meier2017-06-221-1/+1
| | | | | | This is only needed for optional arguments. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Use --help suggestion on invalid optionKarel Zak2016-12-191-1/+1
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: certain long options should not accept argumentsPhil Ruffwind2016-03-061-3/+3
| | | | | | | | As documented in the manual and the usage info, the long options --one-byte-char, --canonical, and --two-bytes-octal should not accept any arguments. Signed-off-by: Phil Ruffwind <rf@rufflewind.com>
* colors: cleanup man pages, add hint to usage()Karel Zak2015-02-251-0/+2
| | | | | | | | cfdisk, fdisk, calm dmesg and hexdump Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-061-0/+4
| | | | | | | | | This adds a concise description of a tool to its usage text. A first form of this patch was proposed by Steven Honeyman (see http://www.spinics.net/lists/util-linux-ng/msg09994.html). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* hexdump: remove deprecation messageSami Kerola2014-10-011-6/+1Star
| | | | | | | | Message 'calling hexdump as od has been deprecated in favor of GNU coreutils od' has informed the hexdump not to be used like that for three and half years, and five releases. It is time to get rid of notice. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: remove some inconsistent periods from error messagesBenno Schulenberg2014-08-111-1/+1
| | | | | | While doing so, also improve translatability and some wordings. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* lib/colors: check for /etc/terminal-colors.d/[util].disableOndrej Oprala2014-03-111-2/+2
| | | | | | | | [kzak@redhat.com: - move paths to pathnames.h, - use static path buffer] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: add highlighting supportOndrej Oprala2014-02-101-1/+22
| | | | | | | | | [kzak@redhat.com: - fix coding style, - use xalloc in all code, - fix strtol usage] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: don't access hex after freeing itAndrew Vagin2014-01-061-1/+5
| | | | | | | [kzak@redhat.com: - remove unnecessary code] Signed-off-by: Andrew Vagin <avagin@openvz.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: use xcalloc()Karel Zak2014-01-061-1/+2
| | | | | Reported-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: Create struct hexdump containing previously global variables.Ondrej Oprala2013-12-021-42/+40Star
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: rename struct _fs to struct hexdump_fs and remove its typedefOndrej Oprala2013-12-021-5/+5
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: rename struct _fu to struct hexdump_fu and remove its typedefOndrej Oprala2013-12-021-2/+2
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: Rename struct _pr to struct hexdump_pr and remove it's typedefOndrej Oprala2013-12-021-2/+2
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: rename rewrite to rewrite_rulesOndrej Oprala2013-12-021-1/+1
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: rename add to add_fmtOndrej Oprala2013-12-021-16/+16
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: Merge hexsyntax.c into hexdump.cOndrej Oprala2013-12-021-1/+116
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: catch memory leaksOndrej Oprala2013-11-081-0/+24
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: simplify newsyntax argumentsOndrej Oprala2013-11-081-1/+1
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: rename next{fs,fu,pr} to {fs,fu,pr}listOndrej Oprala2013-11-081-2/+2
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: formatting and variable name cleanupOndrej Oprala2013-11-081-4/+2Star
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: cleanup of redundant symbols/repeating literalsOndrej Oprala2013-11-081-1/+1
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: use list.h queues and rewrite redundant for cyclesOndrej Oprala2013-11-081-7/+14
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* hexdump: revert global exitval variable changeSami Kerola2013-09-101-2/+2
| | | | | | | | | | | | | | | | | | | | The change f2a037fb7b153954d5d34cca48182b6d8832fcfa had unfavorable effect of making hexdump to return non-zero exit value always. This happen because oversight when 'exitval' gets to be set. By clance, one might expect main() to call next() which will return value for 'exitval'. That assessment misses later call chain main() -> display() -> get() -> next(), which in reverse should return correct value for 'exitval'. It was mentioned in util-linux maillist that Ondrej Oprala is working on major renewal of the hexdump . That in mind it seems best to simply to revert the global 'exitval' and avoid conflict with Ondrej's work. Reference: http://markmail.org/message/sbnvuhkboreujj5p Reported-by: Dave Reisner <d@falconindy.com> CC: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hexdump: remove unnecessary global variablesSami Kerola2013-07-011-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: spell and encode the name of Arkadiusz Miśkiewicz correctlyBenno Schulenberg2013-02-061-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* hexdump: fix shadow declarationSami Kerola2012-07-261-1/+1
| | | | | | | | | text-utils/hexdump.h:84:5: warning: shadowed declaration is here [-Wshadow] ./include/xalloc.h:23:28: warning: declaration of 'size' shadows a global declaration [-Wshadow] ./include/xalloc.h:33:40: warning: declaration of 'size' shadows a global declaration [-Wshadow] ./include/xalloc.h:43:49: warning: declaration of 'size' shadows a global declaration [-Wshadow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hexdump: fix comparison of distinct pointer typesKarel Zak2012-05-231-1/+1
| | | | | | | | display.c: In function ‘get’: display.c:262:117: warning: comparison of distinct pointer types lacks a cast [enabled by default] Signed-off-by: Karel Zak <kzak@redhat.com>
* text-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hexdump: use strtosize() for -n and -sKarel Zak2012-03-211-1/+1
| | | | | | | | strtosize() is based on uintmax_t and supports all possible suffixes (B,M,G,T ...) Reported-by: Simon de Vlieger <simon@ikanobori.jp> Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: don't include err.h directlyKarel Zak2011-04-121-1/+2
|
* hexdump: new usage(), xalloc and err.h stuffSami Kerola2011-02-211-5/+5
| | | | | | | | | | | New usage help screen and print version switch. Also fixes to exit codes, util linux xmalloc replaced emalloc and every error print is using libc error function. [kzak@redhat.com: - minor changes in formatting and coding style] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: remove od functionality in favor to GNU coreutils odSami Kerola2010-12-301-3/+6
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Imported from util-linux-2.11o tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.11b tarball.Karel Zak2006-12-071-1/+1
|
* Imported from util-linux-2.10m tarball.Karel Zak2006-12-071-5/+4Star
|
* Imported from util-linux-2.9v tarball.Karel Zak2006-12-071-0/+9
|
* Imported from util-linux-2.8 tarball.Karel Zak2006-12-071-10/+0Star
|
* Imported from util-linux-2.7.1 tarball.Karel Zak2006-12-071-3/+2Star
|
* Imported from util-linux-2.2 tarball.Karel Zak2006-12-071-0/+79