Sami Kerola
6a41edfa5b
column: fix error reported by smatch
...
column.c:201:2: error: 'for' loop initial declarations are only allowed in C99 mode
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-10 16:48:12 +02:00
Karel Zak
a46e644e5c
column: fix problems with uninitialized variables
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-26 10:23:50 +02:00
Sami Kerola
daf093d264
column.c: global variables removed
...
Variables from global scope are moved to main, and passed as
function arguments where ever they are needed.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-05-19 21:09:24 +02:00
Sami Kerola
02b77f7b2b
column.c: validate numeric user inputs
...
Use strtol_or_err from strutils.h to check numeric user input is
sane.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-05-19 21:09:24 +02:00
Sami Kerola
dcbca568f7
column.c: free memory before exit
...
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-05-19 21:09:24 +02:00
Sami Kerola
4eaeb0ef25
column.c: make table function clarification
...
Readability enchancement, and few variable type changes to be
more proper.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-05-19 21:09:23 +02:00
Sami Kerola
1df29104d0
column.c: coding style fixes
...
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-05-01 19:15:21 +02:00
Sami Kerola
4ef21375ec
column.c: add version printing
...
The patch makes return value to be non-zero when command line
short option is unknown.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-05-01 19:09:54 +02:00
Sami Kerola
12bef81286
column.c: replace emalloc with xcalloc
...
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-05-01 19:08:08 +02:00
Sami Kerola
a29e40cad5
column: use xalloc lib
...
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 10:59:17 +02:00
Karel Zak
6c7d5ae9a2
move struct option to .rodata
...
It does not make sense to have writable large arrays of "struct
option" on the stack.
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-03 15:00:30 +01:00
Fabian Groffen
eb76ca98b0
build-sys: provide alternatives for err, errx, warn and warnx
...
Solaris lacks err, errx, warn and warnx. This also means the err.h header
doesn't exist. Removed err.h include from all files, and included err.h from
c.h instead if it exists, otherwise alternatives are provided.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-02-14 17:45:24 +01:00
Sami Kerola
395801be43
column: data type mismatch compiler warning fixes
...
Following warnings will longer appear when one will compile with
gcc flags -Wall -Wextra -pedantic
column.c:364:2: warning: comparison of unsigned expression < 0 is always false
column.c:369:2: warning: comparison of unsigned expression < 0 is always false
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-25 10:40:36 +01:00
Karel Zak
3f7fc4d43b
column: segfault on empty input
...
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=579955
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-04 22:22:49 +01:00
Sami Kerola
1ae90932bd
column: code readability improvements
...
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2010-10-21 09:41:38 +02:00
Sami Kerola
bf90b8a6af
column: error messaging & exit codes
...
Human understandable error messages along with symbolic exit
codes to comply with coding standard.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2010-10-21 09:41:38 +02:00
Sami Kerola
80fa094c90
column: EOF handling bug
...
For the last line of the file lenght of line should be determined
where the EOF is instead of new line. Old output was
$ printf "1 2\n3" | column -t
column: line too long
1 2
which this commit will change to
$ printf "1 2\n3" | column -t
1 2
3
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-21 09:38:17 +02:00
Sami Kerola
a4cc8dfe7d
column: getopt_long and new help output
...
[kzak@redhat.com: - remove __progname, cleanup usage()]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-07 10:12:34 +02:00
Karel Zak
e42dd65bc3
column: replace errs.h with libc err.h
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-16 12:31:10 +02:00
Karel Zak
06b04b23cd
build-sys: fix ifdef ENABLE_WIDECHAR usage
...
There has been unexpected mix of HAVE_WIDECHAR and ENABLE_WIDECHAR macros. The
ENABLE_WIDECHAR is old version and has to be replaced everywhere otherwise we
will see bugs with multibyte stuff.
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-30 13:49:50 +01:00
Karel Zak
63cccae468
Imported from util-linux-2.11t tarball.
2006-12-07 00:25:58 +01:00
Karel Zak
ffc4374869
Imported from util-linux-2.11o tarball.
2006-12-07 00:25:53 +01:00
Karel Zak
c07ebfa1e0
Imported from util-linux-2.11b tarball.
2006-12-07 00:25:46 +01:00
Karel Zak
66ee8158b6
Imported from util-linux-2.10s tarball.
2006-12-07 00:25:44 +01:00
Karel Zak
22853e4a82
Imported from util-linux-2.10m tarball.
2006-12-07 00:25:43 +01:00
Karel Zak
eb63b9b8f4
Imported from util-linux-2.10f tarball.
2006-12-07 00:25:41 +01:00
Karel Zak
7eda085c41
Imported from util-linux-2.9v tarball.
2006-12-07 00:25:39 +01:00
Karel Zak
5c36a0eb7c
Imported from util-linux-2.9i tarball.
2006-12-07 00:25:37 +01:00
Karel Zak
2b6fc908bc
Imported from util-linux-2.8 tarball.
2006-12-07 00:25:35 +01:00
Karel Zak
fd6b7a7ffc
Imported from util-linux-2.7.1 tarball.
2006-12-07 00:25:34 +01:00
Karel Zak
6dbe3af945
Imported from util-linux-2.2 tarball.
2006-12-07 00:25:32 +01:00