summaryrefslogtreecommitdiffstats
path: root/text-utils
Commit message (Collapse)AuthorAgeFilesLines
* include/c: move usleep() fallback to c.hKarel Zak2012-10-221-1/+0Star
| | | | | | To make it available everywhere in code. Signed-off-by: Karel Zak <kzak@redhat.com>
* more: remove few memory leaksSami Kerola2012-10-151-1/+7
| | | | | | | The remaining memory leaks are related to ncurses internals, or the one open file descriptor when user users 'q' to exit. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* more: align void in functions with prototypes, and remove void castsSami Kerola2012-10-151-14/+14
| | | | | | | | If there is void in argument list at function prototype it is reasonable to expect to see it also where the function is wrote. This change also removes unnecessary return value void casting. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* more: fix coding styleSami Kerola2012-10-151-1714/+1694Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pg: fix coding styleSami Kerola2012-10-151-399/+287Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pg: do not turn off warnigns artificiallySami Kerola2012-10-151-21/+0Star
| | | | | | | | Compiler warnings often mean something, fiddling with them is not good practise. Besides the 'proglem' removed macro tried to 'fix' does not even occur when compiling with modern gcc. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pg: use unistd.h STDOUT_FILENOSami Kerola2012-10-151-26/+26
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pg: add noreturn function attributesSami Kerola2012-10-151-5/+5
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pg: add const qualifiers where suitableSami Kerola2012-10-151-10/+13
| | | | | | | | | | | | Includes a fix also to one assignment warning (see below). text-utils/pg.c:1477:24: warning: assignment discards 'const' qualifier \ from pointer target type [enabled by default] [kzak@redhat.com: - use const char rather than xstrdup() for static /bin/sh string] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* pg: use libc error printing facilitiesSami Kerola2012-10-151-27/+12Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pg: refactor argument handingSami Kerola2012-10-151-75/+84
| | | | | | | Add function parse_arguments(), which has the same code block that was in over long, and too deeply intended, main(). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: fix column.1 groff syntax errorSami Kerola2012-10-151-1/+1
| | | | | | Quote backslash which user is expected to see. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* column: add --output-separator optionSami Kerola2012-10-152-5/+17
| | | | | | | | | | The --output-separator option will allow user to define table column separator. This will allow for example to write back same delimeter as which was used as input separator, for example column -t -s : -o : /etc/passwd Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pg: check numeric user inputsSami Kerola2012-10-152-4/+7
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* column: describe change of separator behavior in man page bugs sectionSami Kerola2012-10-021-0/+20
| | | | | | | | | | | Add to manual page how to achieve old behavior, just in case someone relies on buggy behavior of the command. [kzak@redhat.com: - remove unnecessary info from the man page :-)] Reported-by: Padraig Brady <P@draigBrady.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* column: clarify the --separator optionPádraig Brady2012-10-022-3/+3
| | | | | | Indicate that the string is a set, which also clarifies that it's only significant when parsing the input.
* column: make defined separator to be non-greedySami Kerola2012-10-021-5/+32
| | | | | | | | | | | | | | | | | | | | | | | This patch changes interpretation of subsequent delimeter interpretation. Earlier version merged columns that had null string as content together, which lead to output as visualized below. $ printf "a:b:c\n1::3\n" | column -t -s ':' a b c 1 3 The number 3 has wrong column, which this patch takes care of, and alters the output following way. $ printf "a:b:c\n1::3\n" | column -t -s ':' a b c 1 3 This patch does not alter the default case, e.g., subsequent white spaces are understood as separator of the same field, and the beginning of line white spaces are being ignored together. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mark expected fallthrough for static analysersKarel Zak2012-09-071-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: fix typos in messagesYuri Chornoivan2012-09-041-1/+1
|
* col: fix compiler warning [-Wstrict-prototypes]Karel Zak2012-09-041-1/+1
| | | | | | text-utils/col.c:142:43: warning: function declaration isn’t a prototype [-Wstrict-prototypes] Signed-off-by: Karel Zak <kzak@redhat.com>
* column: --separator segfaultsB Watson2012-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --separator and --columns long options in util-linux-2.21.2 and in a git clone from 5 minutes ago, don't work: $ echo foobar | column -s x foobar $ echo foobar | column -c 10 foobar $ echo foobar | column --separator=x column: option '--separator' doesn't allow an argument $ echo foobar | column --separator x Segmentation fault $ echo foobar | column --columns 10 column: bad columns width value: '(null)': Invalid argument $ echo foobar | column --columns=10 column: option '--columns' doesn't allow an argument Looks like a simple case of missing has_arg flag in the "struct option" initialization for these two options. The patch just adds the flag. I haven't done thorough testing of the patched code, but it seems to work OK and it no longer segfaults or tries to dereference a null pointer. Signed-off-by: Karel Zak <kzak@redhat.com>
* more: add noreturn function attributeSami Kerola2012-07-261-1/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hexdump: fix shadow declarationSami Kerola2012-07-263-3/+3
| | | | | | | | | 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>
* ul: fix shadow declarationSami Kerola2012-07-261-3/+3
| | | | | | | text-utils/ul.c:641:25: warning: declaration of 'col' shadows a global declaration [-Wshadow] text-utils/ul.c:126:5: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* more: fix shadow declarationSami Kerola2012-07-261-3/+3
| | | | | | | text-utils/more.c:1123:13: warning: declaration of 'state' shadows a previous local [-Wshadow] text-utils/more.c:1095:18: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tailf: fix compiler warning [-Wmissing-prototypes]Karel Zak2012-07-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* colrm: fix compiler warning [-Wmissing-prototypes]Karel Zak2012-07-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* translation: unify file open error messagesSami Kerola2012-07-164-5/+5
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* translation: unify stat error messagesSami Kerola2012-07-161-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: always use default $(LDADD)Karel Zak2012-07-091-12/+12
| | | | | | | | The global variable $(LDADD) is always used if program_LDADD is not specified. Let's use $LDADD everywhere to avoid exceptions for people who need to specify global $LDADD. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: cleanup .gitignore filesKarel Zak2012-06-261-11/+0Star
| | | | | | | - move all binaries to top-level .gitignore - remove unnecessary */.gitignore files Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: convert lib/ to libcommon.laKarel Zak2012-06-261-15/+10Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: convert term-utils/ to moduleKarel Zak2012-06-261-62/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: convert text-utils/ to moduleKarel Zak2012-06-261-0/+86
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* more: fix pointer wrap around compiler warningsSami Kerola2012-06-171-5/+3Star
| | | | | | | more.c:318:5: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow] more.c:362:3: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* more: fix search repetition regressionSami Kerola2012-06-171-1/+13
| | | | | | | Commit 596007ef6a37b708f44286932eed667b316e5f70 introduced a bug crashing more always when a text search was repeated with 'n' command. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hexdump: print sensible message when all input file arguments failSami Kerola2012-06-171-0/+5
| | | | | | | | | | | | | | | | | Earlier hexdump printed unnecessary, and perhaps even misleading, 'bad file descriptor' message. $ hexdump foobar hexdump: foobar: No such file or directory hexdump: foobar: Bad file descriptor The message is changed to $ hexdump foobar hexdump: foobar: No such file or directory hexdump: all input file arguments failed Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Fix typos in comments and wall's man pageBernhard Voelker2012-06-051-1/+1
| | | | | | | | | | | Culprits identified again by (newer) misspellings: $ git ls-files | misspellings -f - | grep -v '^po/' * wall: Fix typo in man page. * Fix typos in source code comments. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* text-utils/hexsyntax.c: fix for missing program_invocation_short_nameAndreas Bießmann2012-06-051-0/+1
| | | | | | | | | | | | | | | Some libc do not expose program_invocation_short_name. Therefore util-linux comes with helpers in 'c.h'. Use the 'c.h' in hexsyntax.c where it was missed. This patch fixes following error for me: ---8<--- hexsyntax.c: In function 'newsyntax': hexsyntax.c:115: error: 'program_invocation_short_name' undeclared (first use in this function) hexsyntax.c:115: error: (Each undeclared identifier is reported only once hexsyntax.c:115: error: for each function it appears in.) --->8--- Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
* more: fix regex error messages printingKarel Zak2012-06-051-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* more: remove a meaningless testJeremy Huntwork2012-06-051-2/+1Star
| | | | | | | regexec only returns 0 or REG_NOMATCH so remove a meaningless test Signed-off-by: Jeremy Huntwork <jhuntwork@lightcubesolutions.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: fix comparison of distinct pointer typesKarel Zak2012-05-233-4/+3Star
| | | | | | | | 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: use min() from c.hPetr Uzel2012-05-231-5/+2Star
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* Merge branch 'master' of https://github.com/jhuntwork/util-linuxKarel Zak2012-05-231-6/+7
|\
| * Use POSIX regcomp and regexec over obsolete BSD re_comp and re_execJeremy Huntwork2012-05-131-6/+7
| |
* | text-utils: cleanup strtoxx_or_err()Karel Zak2012-05-152-24/+11Star
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | include: rename writeall.h to all-io.hPetr Uzel2012-05-151-1/+1
| | | | | | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* | rev: mention tac(1) in 'SEE ALSO' man page sectionPetr Uzel2012-05-151-0/+2
|/ | | | | | | Cc: James R. Van Zandt <jrv@debian.org> From: James R. Van Zandt <jrv@debian.org> Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568709 Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* Fix typos found by misspellingsBernhard Voelker2012-04-232-3/+3
| | | | | | | | | | | | | | | The tool misspellings (https://github.com/lyda/misspell-check) detected several typos. Command used: $ git ls-files | grep -v ^po/ | misspellings -f - * isosize: Fix typo in usage string. * configure.ac: Fix typo in help string of --enable-most-builds option. * fdisk: Fix typo in man page. * libblkid, blkid, mount: Likewise. * Fix various typos in docs and in source code comments. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* text-utils: verify writing to streams was successfulSami Kerola2012-04-0410-20/+29
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>