Karel Zak
ee312c654b
docs: fix "behaviour" vs. "behavior"
...
Sometimes we use "behaviour" and "behavior" in the same text, let's
use "behavior" only everywhere.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1011068
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-06 09:49:35 +02:00
Karel Zak
cb45354ec6
build-sys: add BUILD_{COL,COLCRT,COLRM,COLUMN,HEXDUMP,REV,TAILF}
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 14:09:43 +02:00
Karel Zak
052e512a64
hexdump: add --color to the man page
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:13:02 +02:00
Karel Zak
58ce71e63e
hexdump: use new colors API
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:09:03 +02:00
Sami Kerola
acb5f9b56e
column: inform user when multibyte conversion error occurs
...
The column(1) read input until conversion error, and used incomplete
input when outputing, that made at least me to wonder where the rest
disappeared without explanation. IMHO it is better to fail immediately
rather than do only half of the task.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-07 11:28:48 +02:00
Benno Schulenberg
aa06617f6e
textual: remove square brackets from around three dots
...
Also improve some option descriptions here and there.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-05-06 11:12:13 +02:00
Karel Zak
b6a8cc0130
Merge branch 'pg-manual-page-long-options' of https://github.com/jaalto/util-linux
...
* 'pg-manual-page-long-options' of https://github.com/jaalto/util-linux :
pg.1: Move (plus) options near (minus) option at the beginning
pg.1: Add -h, --help, -V, --version
2014-04-01 11:37:06 +02:00
Karel Zak
60ec67ff4e
lib/colors: add info to man pages, add terminal-colors.d.5
...
Co-Author: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 10:05:32 +01:00
Ondrej Oprala
d0c9ddc3cc
lib/colors: check for /etc/terminal-colors.d/[util].disable
...
[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>
2014-03-11 09:38:09 +01:00
Benno Schulenberg
01cc21f5b6
docs: fix two command representations in the man page of more
...
The previous-file command is not :P but :p, and the back-to-where
command is not an acute accent but an apostrophe. Also condense
some of the descriptions and remove some useless comments.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-03-04 13:52:14 +01:00
Ondrej Oprala
3bf7ede997
hexdump: color unit may now be longer than the corresponding format unit
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-03-04 12:48:59 +01:00
Sami Kerola
5fdd35070c
more: fix double free crash
...
Commit b9579f1f44
moved fclose() to
checkf(), but missed removing file closure in magic(). Ironically the
cause of regression is in previous commit message.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-02-21 13:45:32 +01:00
Benno Schulenberg
4c5a6f3d39
more: improve formatting and wording of man page and help text
...
Also, slice up the usage text for ease of translation.
Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-02-21 11:57:05 +01:00
Sami Kerola
100af0035e
docs: make hexdump.1 color specification easier to understand
...
Fix also spacing, input line lenghts, and troff table for data that is a
table.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-02-17 14:04:37 +01:00
Ondrej Oprala
098ab0778f
hexdump: add highlighting support
...
[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>
2014-02-10 16:01:37 +01:00
Karel Zak
a5bd793996
include/c.h: prefer nanosleep() over usleep()
...
Let's use nanosleep() although if usleep() exists. The nanosleep
function does no interact with signals and other timers.
The patch introduces xusleep() as replacement to libc (or our fallback)
usleep(). Yes, we don't want to use struct timespec + nanosleep()
everywhere in code as nano-time resolution is useless for us.
The patch also enlarges delays in some busy wait loops. It seems
enough to try read/write 4x per second.
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-24 13:04:14 +01:00
Karel Zak
cd70a4606a
column: fix mem leak [coverity scan]
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-14 17:55:05 +01:00
Karel Zak
b9579f1f44
more: fix mem leak [coverity scan]
...
... the code is so soo ugly.
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-14 17:54:57 +01:00
Andrew Vagin
5500c81742
hexdump: convert a variable type according with fmt
...
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>
2014-01-06 14:02:21 +01:00
Andrew Vagin
917c3733f8
hexdump: don't access hex after freeing it
...
[kzak@redhat.com: - remove unnecessary code]
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-06 14:01:04 +01:00
Karel Zak
2152af7289
hexdump: use xcalloc()
...
Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-06 13:54:48 +01:00
Ondrej Oprala
1f77e9c3ad
hexdump: Create struct hexdump containing previously global variables.
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:24 +01:00
Ondrej Oprala
1be6ed6ade
hexdump: add __attribute__ ((__noreturn__)) to bad*() functions
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:24 +01:00
Ondrej Oprala
bb8ae572ef
hexdump: rename struct _fs to struct hexdump_fs and remove its typedef
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:23 +01:00
Ondrej Oprala
046921da22
hexdump: rename struct _fu to struct hexdump_fu and remove its typedef
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:22 +01:00
Ondrej Oprala
4c73d29c06
hexdump: Rename struct _pr to struct hexdump_pr and remove it's typedef
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:21 +01:00
Ondrej Oprala
9f399910f2
hexdump: rename rewrite to rewrite_rules
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:21 +01:00
Ondrej Oprala
9fa53cebe4
hexdump: rename add to add_fmt
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:20 +01:00
Ondrej Oprala
d4646ea4b0
hexdump: Merge hexsyntax.c into hexdump.c
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:19 +01:00
Ondrej Oprala
af324b1f72
hexdump: add the prefix 'hexdump-' to {conv,display,parse}.c
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:17 +01:00
Ondrej Oprala
d2740b0ef6
hexdump: catch memory leaks
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 14:16:29 +01:00
Ondrej Oprala
3917a95d90
hexdump: make addfile() variable names more hinting of their purpose
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 14:16:04 +01:00
Ondrej Oprala
0acd3f5d0f
hexdump: use skip_space() in add()
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 14:15:39 +01:00
Ondrej Oprala
d01d144c4b
hexdump: rename in() to first_letter()
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-08 13:54:32 +01:00
Ondrej Oprala
cb98600831
hexdump: get rid of redundant typecasts
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 13:51:19 +01:00
Ondrej Oprala
cda433918e
hexdump: minor formatting improvements in display()
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-08 13:49:57 +01:00
Ondrej Oprala
f65e62e0ab
hexdump: rewrite cluttered case statements
...
[kzak@redhat.com: - use strchr() for in() macro]
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-08 13:42:39 +01:00
Ondrej Oprala
53a9a9939e
hexdump: use xasprintf in conv_c()
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:53 +01:00
Ondrej Oprala
5988eede0d
hexdump: delete redundant typecasts
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:53 +01:00
Ondrej Oprala
961b4cd642
hexdump: use GNU case ranges where possible
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:53 +01:00
Ondrej Oprala
bec2d4582f
hexdump: use xstrncpy in add()
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:53 +01:00
Ondrej Oprala
2f83c8f032
hexdump: simplify newsyntax arguments
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:53 +01:00
Ondrej Oprala
acf74fc29d
hexdump: minor formatting improvements
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:53 +01:00
Ondrej Oprala
bbc8c1531f
hexdump: rename next{fs,fu,pr} to {fs,fu,pr}list
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:52 +01:00
Ondrej Oprala
96ea3d3200
hexdump: rewrite addfile() to use getline()
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:52 +01:00
Ondrej Oprala
d6e5614e5d
hexdump: formatting and variable name cleanup
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:52 +01:00
Ondrej Oprala
dabfe2ad7c
hexdump: rewrite() formatting improvements
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:52 +01:00
Ondrej Oprala
9c2cb9b0ea
hexdump: rewrite escape()
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:52 +01:00
Ondrej Oprala
eef27d32fa
hexdump: rewrite rewrite()
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:52 +01:00
Ondrej Oprala
7e6e290be9
hexdump:rewrite add()
...
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-11-08 12:54:52 +01:00