summaryrefslogtreecommitdiffstats
path: root/text-utils
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* column: use variable lenght printf field width to wprint blanksSami Kerola2013-08-051-3/+2Star
| | | | | | | This makes program to run a little faster. My test input show about 20% speed improvement. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* more: guarantee space for multibyteKarel Zak2013-08-011-0/+6
| | | | | | .. to make the code more robust. Signed-off-by: Karel Zak <kzak@redhat.com>
* more: check for buffer size when write multibyte charKarel Zak2013-08-011-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rev: use string printing rather than character outputSami Kerola2013-08-011-8/+13
| | | | | | | Fliping a string in memory, and printing it with multibyte output function makes the command about 1/3 quicker. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* more: fix buffer overflowKarel Zak2013-08-011-1/+2
| | | | | | | | | The bug has been probably introduced by commit 1ac300932deab8dea2c43050921bbbdb36d62ff1. Reported-by: "Dr. David Alan Gilbert" <dave@treblig.org> References: https://bugzilla.novell.com/show_bug.cgi?id=829720 Signed-off-by: Karel Zak <kzak@redhat.com>
* more: use variable lenght printf field width to print blanksSami Kerola2013-07-091-2/+1Star
| | | | | | This makes program to run a little faster. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* column: dereference of null pointer [clang-analyzer]Sami Kerola2013-07-091-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ul: use string printing functionSami Kerola2013-07-091-4/+2Star
| | | | | | | Use of for loop and printing a string character by character is slower than to print whole string with single function. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ul: use correct typesSami Kerola2013-07-091-3/+3
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* more: assigned value is never read [clang-analyzer]Sami Kerola2013-07-091-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ul: enhance command performanceSami Kerola2013-07-011-4/+4
| | | | | | | | | | | | | | | | | | | | Avoid reseting, time after time, the memory which was not used. Effect of the change is below in before and after timings. $ time ./ul </etc/services >/dev/null real 0m0.320s user 0m0.307s sys 0m0.010s $ time ./ul </etc/services >/dev/null real 0m0.068s user 0m0.050s sys 0m0.017s [kzak@redhat.com: - add "else" and use maxcol] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: remove unnecessary global variablesSami Kerola2013-07-013-7/+5Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pg.c: Add --help and --versionJari Aalto2013-06-181-2/+15
| | | | | | | [kzak@redhat.com: - use USAGE_{HELP,VERISON} macros] Signed-off-by: Jari Aalto <jari.aalto@cante.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* rev: reduce stream checking when closing read-only file descriptorSami Kerola2013-06-071-4/+1Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* rev: simplify new line detection and impossible testSami Kerola2013-06-071-5/+4Star
| | | | | | | | | | | The new line detection is earlier using only '\n' so there should not be need to search for '\r' later. The detection whether allocated address is pointing to null seems to be unnecessary. Assuming xmalloc() returned valid address space the address should never be 0. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* rev: stop adding new line at the end when input does not have itSami Kerola2013-06-071-1/+2
| | | | | | | | | | When the rev(1) is executed twice outcome is expected to be exactly what it was originally. That includes not adding new line at the end of the output. The oneliner below demonstrates earlier issue. $ printf "abc\n123" | rev | rev Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: slightly correct the man page of columnBenno Schulenberg2013-06-071-10/+11
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: fix several typos and angular brackets in messagesBenno Schulenberg2013-06-071-3/+3
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* standard SEE ALSO section of man pagesMike Frysinger2013-05-131-1/+2
| | | | | | | | The standard format is to seperate each entry with a comma, and for each one to be on a line by itself. Most util-linux pages follow this, but a few do not. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* build-sys: use -Wno-clobbered for some BSD crapKarel Zak2013-05-071-0/+2
| | | | | | | | * extend UL_WARN_ADD() for accept non-default CFLAGS variable * add BSD_WARN_CFLAGS with -Wno-clobbered * use all this for pg(1) and more(1) Signed-off-by: Karel Zak <kzak@redhat.com>
* pg: check writing to a file was successfulSami Kerola2013-04-261-1/+8
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hexdump: add long options to the commandSami Kerola2013-04-262-33/+52
| | | | | | Includes update to bash completion, and manual as well. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Fix various typosYuri Chornoivan2013-04-261-1/+1
|
* docs: col.1: fix manual page name section [checkmans.sh]Sami Kerola2013-04-091-1/+1
| | | | | | | $ lexgrog text-utils/col.1 text-utils/col.1: parse failed Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount, col: remove redundant null checks [smatch scan]Sami Kerola2013-04-091-2/+1Star
| | | | | | | | libmount/src/context_umount.c:174 mnt_context_find_umount_fs() info: redundant null check on loopdev calling free() libmount/src/context_umount.c:179 mnt_context_find_umount_fs() info: redundant null check on loopdev calling free() text-utils/col.c:406 flush_lines() info: redundant null check on l->l_line calling free() Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* various: fix variable and function declarations [smatch scan]Sami Kerola2013-04-093-13/+13
| | | | | | | | | | | | | | | | | disk-utils/fsck.minix.c:511:9: warning: mixing declarations and code fdisks/sfdisk.c:982:5: warning: mixing declarations and code fdisks/sfdisk.c:1254:5: warning: mixing declarations and code fdisks/sfdisk.c:1564:5: warning: mixing declarations and code lib/mbsalign.c:279:7: warning: mixing declarations and code libblkid/src/devname.c:378:17: warning: mixing declarations and code libfdisk/src/alignment.c:219:9: warning: mixing declarations and code term-utils/wall.c:111:9: warning: mixing declarations and code text-utils/col.c:418:19: warning: non-ANSI function declaration of function 'flush_blanks' text-utils/col.c:553:12: warning: non-ANSI function declaration of function 'alloc_line' text-utils/rev.c:105:9: warning: mixing declarations and code text-utils/tailf.c:245:9: warning: mixing declarations and code Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ul: cleanup usage() and man pageKarel Zak2013-04-052-11/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pg: fix memory leak [coverity scan]Karel Zak2013-03-271-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: make the section AVAILABILITY always come last in man pagesBenno Schulenberg2013-03-201-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* docs: add TB to list of supported suffixesKarel Zak2013-03-181-1/+1
| | | | | Reported-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* translation: unify exec error messagesSami Kerola2013-02-061-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* a pointer should not be compared to zero [coccinelle]Sami Kerola2013-02-061-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: spell and encode the name of Arkadiusz Miśkiewicz correctlyBenno Schulenberg2013-02-0610-10/+10
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: standardize the reporting of program name plus package versionBenno Schulenberg2013-01-301-2/+1Star
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* column: make usage() translator friendlySami Kerola2013-01-251-15/+14Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: standardize reporting of program name plus package versionBenno Schulenberg2013-01-251-1/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: remove inconsistent periods from two error messagesBenno Schulenberg2013-01-251-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: fix a few typos in some of the usage help textsBenno Schulenberg2013-01-251-2/+2
| | | | | | Also improve clarity of some other lines of those texts. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* more: allow to compile as non-interactive test_more programKarel Zak2013-01-242-0/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add --disable-{more,ul,pg}Karel Zak2013-01-241-22/+32
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: do not segfault when iterating over an empty format stringOndrej Oprala2013-01-101-7/+9
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* more: remove unnecessary variableSami Kerola2012-12-191-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>