summaryrefslogtreecommitdiffstats
path: root/text-utils
Commit message (Collapse)AuthorAgeFilesLines
...
* | column: fix mem leak [coverity scan]Karel Zak2014-01-141-1/+3
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | more: fix mem leak [coverity scan]Karel Zak2014-01-141-1/+3
| | | | | | | | | | | | ... the code is so soo ugly. Signed-off-by: Karel Zak <kzak@redhat.com>
* | hexdump: convert a variable type according with fmtAndrew Vagin2014-01-061-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hexdump works uncorrectly on Rassberry Pi (raspbian wheezy): 0000000 3200000000 3400000000 3600000000 3800000000 a00000000 000000a The problem is that the %qx format is used for printing the (short int) variable. Here is the output from hexdump with this patch: 0000000 3231 3433 3635 3837 0a39 000000a Currently raspbian uses hexdump from bsdmainutils. bsdmainutils: /usr/bin/hexdump Signed-off-by: Andrew Vagin <avagin@openvz.org>
* | 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-024-89/+90
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: add __attribute__ ((__noreturn__)) to bad*() functionsOndrej Oprala2013-12-021-24/+20Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rename struct _fs to struct hexdump_fs and remove its typedefOndrej Oprala2013-12-024-15/+15
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rename struct _fu to struct hexdump_fu and remove its typedefOndrej Oprala2013-12-024-15/+15
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: Rename struct _pr to struct hexdump_pr and remove it's typedefOndrej Oprala2013-12-025-18/+20
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rename rewrite to rewrite_rulesOndrej Oprala2013-12-023-3/+3
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rename add to add_fmtOndrej Oprala2013-12-023-19/+19
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: Merge hexsyntax.c into hexdump.cOndrej Oprala2013-12-024-163/+117Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: add the prefix 'hexdump-' to {conv,display,parse}.cOndrej Oprala2013-12-024-3/+3
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: catch memory leaksOndrej Oprala2013-11-083-4/+32
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: make addfile() variable names more hinting of their purposeOndrej Oprala2013-11-081-6/+6
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: use skip_space() in add()Ondrej Oprala2013-11-081-9/+4Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rename in() to first_letter()Ondrej Oprala2013-11-081-8/+8
| | | | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | hexdump: get rid of redundant typecastsOndrej Oprala2013-11-082-10/+10
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: minor formatting improvements in display()Ondrej Oprala2013-11-081-13/+22
| | | | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | hexdump: rewrite cluttered case statementsOndrej Oprala2013-11-081-133/+104Star
| | | | | | | | | | | | | | [kzak@redhat.com: - use strchr() for in() macro] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | hexdump: use xasprintf in conv_c()Ondrej Oprala2013-11-081-2/+4
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: delete redundant typecastsOndrej Oprala2013-11-081-10/+10
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: use GNU case ranges where possibleOndrej Oprala2013-11-081-4/+4
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: use xstrncpy in add()Ondrej Oprala2013-11-081-2/+2
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: simplify newsyntax argumentsOndrej Oprala2013-11-083-7/+5Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: minor formatting improvementsOndrej Oprala2013-11-081-18/+18
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rename next{fs,fu,pr} to {fs,fu,pr}listOndrej Oprala2013-11-084-33/+33
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rewrite addfile() to use getline()Ondrej Oprala2013-11-081-9/+8Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: formatting and variable name cleanupOndrej Oprala2013-11-085-27/+33
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rewrite() formatting improvementsOndrej Oprala2013-11-081-29/+28Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rewrite escape()Ondrej Oprala2013-11-081-1/+3
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rewrite rewrite()Ondrej Oprala2013-11-081-105/+122
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump:rewrite add()Ondrej Oprala2013-11-081-5/+3Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rewrite next()Ondrej Oprala2013-11-081-1/+1
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rewrite get()Ondrej Oprala2013-11-081-1/+2
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: rewrite addfile()Ondrej Oprala2013-11-081-6/+8
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: cleanup of redundant symbols/repeating literalsOndrej Oprala2013-11-083-26/+27
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | hexdump: use list.h queues and rewrite redundant for cyclesOndrej Oprala2013-11-085-104/+141
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | pg: use LC_ALLKarel Zak2013-10-181-1/+1
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | more: fix warning when compiled --without-ncursesKarel Zak2013-10-151-1/+1
| | | | | | | | | | Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* | docs: standardize the phrases for --help and --version in all man pagesBenno Schulenberg2013-10-157-12/+12
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | textual: use the standard angular brackets for non-literal argumentsBenno Schulenberg2013-10-081-1/+1
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | hexsyntax: in help text, wrap argument of option -e in angular bracketsBenno Schulenberg2013-10-081-1/+1
| | | | | | | | | | Reported-by: Petr Písař <petr.pisar@atlas.cz> Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | build-sys: use tinfo *or* ncurses for more(1), ul(1) and setterm(1)Karel Zak2013-10-041-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | * it seems that we don't have to link the utils with ncurses, tinfo is enough. This change saves one unnecessary dependence. * libtinfo is also distributed with pkg-config files, so we can use PKG_CHECK_MODULES() as a primary source for LIBS and CFLAGS. * add TINFO_CFLAGS (although it's probably always empty) Signed-off-by: Karel Zak <kzak@redhat.com>
* | include: Add missing includesMichael Forney2013-10-041-0/+1
| | | | | | | | | | | | | | | | sys/types.h: For u_char typedef sys/params.h: For MAXNAMLEN sys/ttydefaults.h: For various tty definitions (also add configure check) Signed-off-by: Karel Zak <kzak@redhat.com>
* | clean up term lib handlingMike Frysinger2013-09-301-20/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ncurses package has been providing pkg-config files for a while now. So let's start using them to get the proper linker & compiler flags. It can make a difference when ncurses is configured in a way that requires extra link time flags but util-linux doesn't provide them, or when the headers live in a weird place and util-linux can't find them. Since the NCURSES_LIBS is always defined for the Makefile, there's no need to gate on the HAVE_NCURSES conditional. When it's disabled, the var will simply be empty. With a minor tweak to how tinfo is handled, we can do the same thing -- we just always use TINFO_LIBS in the Makefile's. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | rev: fix new line regressionSami Kerola2013-09-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | Commit 4b4eb34004378fe70259acd8f2f859e7b5cc3726 made output incorrect for input lines that does not have new line. For example $ printf "a b c\n1 2 3" | rev c b a 2 13 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | hexdump: revert global exitval variable changeSami Kerola2013-09-103-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | more: make output redirection more efficientSami Kerola2013-08-051-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Especially with large inputs the change improves performance considerably. old> time more /boot/vmlinuz >/dev/null real 0m0.224s new> more /boot/vmlinuz >/dev/null real 0m0.009s Signed-off-by: Sami Kerola <kerolasa@iki.fi>