Commit Graph

650 Commits

Author SHA1 Message Date
Randy Dunlap 0fa7180bcd more: cleanup gcc warnings
Fix strict gcc warnings that come from using:
  ("-Wall -Wp,-D_FORTIFY_SOURCE=2")

more.c:185: warning: passing argument 1 of 'setupterm' discards qualifiers from pointer target type
more.c:205: warning: passing argument 1 of 'tparm' discards qualifiers from pointer target type
more.c:812: warning: pointer targets in passing argument 2 of 'mbrtowc' differ in signedness
more.c:931: warning: pointer targets in passing argument 2 of 'mbrtowc' differ in signedness
more.c:1285: warning: pointer targets in passing argument 1 of 'ttyin' differ in signedness
more.c:1486: warning: pointer targets in passing argument 1 of 'ttyin' differ in signedness
more.c:1879: warning: pointer targets in passing argument 2 of 'mbrtowc' differ in signedness

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
2007-11-05 14:02:59 +01:00
lizf 8d26614050 tailf: opened file leaving unclosed
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
2007-10-26 01:02:45 +02:00
Li Zefan fffe39059d rev: use warn() in errs.h
The function warn() in rev.c is actually duplicate code,
so here we remove it.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-25 21:50:59 +02:00
Karel Zak f018b8f899 tailf: replace errs.h with libc err.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-18 14:59:23 +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
Li Zefan cf9fc1dfe5 tailf: add option -n to specifying output lines
It will be useful if we can print out the last n lines instead of the last
10, just like tail.

There are examples:

tailf -n 5 file1
tailf --lines 10 file2
tailf -20 file3

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-11 13:57:35 +02:00
Karel Zak 642035150e tailf: clean up gcc warnings & fix use of errno
Fix strict gcc warnings in tailf that come from using:
  ("-Wall -Wp,-D_FORTIFY_SOURCE=2")

tailf.c:111: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result

Also, tailf uses perror() for error reporting, but it inserts
an fprintf call first, so perror() is actually reporting the
result of the fprintf() call, not the failing call; change
the code to print the message by using strerror() instead.

Builds cleanly on x86_32 and x86_64.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-11 13:19:55 +02:00
Rajeev V. Pillai 2b00dd6d54 pg: fix segfault on search
Run pg(1) and type '/<CR>' which is supposed to forward search for the
previously remembered search string. pg(1) will segfault after printing
"No remembered search string:".

Signed-off-by: Rajeev V. Pillai <rajeevvp@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-03 22:39:27 +02:00
Mike Frysinger 8b7f16fc37 build-sys: nls/locale handling in util-linux-ng general
On Monday 03 September 2007, Karel Zak wrote:
> http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/590/focus=592
>
>  I agree that we need a better support for compilation without
>  locales, but from my point of view NLS != all locales stuff. The NLS
>  support is subset only.

thinking about the input from everyone, i'd propose the attached ...

Only pull in locale.h as needed and move it to the common nls.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2007-09-19 23:15:21 +02:00
Karel Zak 99bd8154ad more: fix underlining for multibyte chars
Try:
	$ printf "aaa _\bŽ_\bŽ_\bŽ bbb\n" | more
	aaa ŽŽŽ bbb

(ŽŽŽ has to be three underlined chars on terminal).

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-14 11:51:19 +02:00
LaMont Jones 0c1a6f8835 manpage typos
Signed-off-by: LaMont Jones <lamont@mmjgroup.com>
2007-07-24 13:51:06 +02:00
Karel Zak 86d62711a9 man pages: add "AVAILABILITY" section
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-03 01:17:04 +02:00
Arkadiusz Miskiewicz 46e711180f build-sys: fix linking when ncurses is built with --with-termlib=tinfo
When system ncurses is built with --with-termlib=tinfo option
then there are two libraries - libtinfo (which contains terminal
related functions) and libncurses (rest).

Correctly link against libtinfo in such case.

Signed-off-by: Arkadiusz Miskiewicz <arekm@maven.pl>
2007-07-02 16:26:20 +02:00
Karel Zak 04b7cb3216 text-utils: fix the more command compilation against termcap
The build-sys (text-utils/Makefile.am) allows to compile against
ncurses and termcap. The termcap version is broken in more.c.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-05 23:35:42 +02:00
Stepan Kasal 81c3ab2d60 build-sys: do not use wildcards in EXTRA_DIST
Wildcards in EXTRA_DIST break "make dist" for vpath build.
But plain directory names are ok.

Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-05-16 11:43:30 +02:00
Karel Zak b8d1314dc6 build-sys: fix README filenames and add missing files to EXTRA_DISTs
Also, the patch makes "make mrproper" more robust.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-02-08 12:38:25 +01:00
Karel Zak e9ce5ccc90 col: getwchar() errors shouldn't be hidden
The col truncates output when multibyte errors is detected, but the problem is
not reported to stderr and return code is still same like for successful exit.
This stupid behaviour is fixed by this patch.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-30 13:52:48 +01: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 42c9ce52aa hexdump: don't use memset with zero lenght
gcc 4.1.0: "warning: memset used with constant zero length parameter...."

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-17 14:27:15 +01:00
Karel Zak 8271f58d51 more: fix file descriptor leak
When you view a file with the more command and run a shell, the file descriptor
for reading the file is leaked to that process.

To test, more any file. Then do !/bin/sh. At the prompt do "ls -l /proc/$$/fd"
and you'll see the leaked fd.

From: Steve Grubb <sgrubb@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-04 14:40:00 +01:00
Karel Zak 562218e6ea build-sys: add missing files
This patch add all missing headers, man pages and README files to automake
stuff and "make dist-gzip" produces useful tarball now.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-04 11:57:07 +01:00
Karel Zak 8eeb575c0d build-sys: remove generated autotools stuff from git
The generated autotools stuff shouldn't be maintained by SCM. After check out
from git use ./autogen.sh. For more details see README.devel.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-03 22:20:44 +01:00
Karel Zak cf6d7faebb Imported from util-linux-2.13-pre6 tarball. 2006-12-07 00:27:13 +01:00
Karel Zak ca3ea756e7 Imported from util-linux-2.13-pre4 tarball. 2006-12-07 00:27:06 +01:00
Karel Zak 9cb689775c Imported from util-linux-2.13-pre3 tarball. 2006-12-07 00:27:03 +01:00
Karel Zak baf39af15b Imported from util-linux-2.13-pre2 tarball. 2006-12-07 00:26:58 +01:00
Karel Zak 48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
Karel Zak bf3baa9907 Imported from util-linux-2.12p tarball. 2006-12-07 00:26:33 +01:00
Karel Zak d162fcb550 Imported from util-linux-2.12j tarball. 2006-12-07 00:26:24 +01:00
Karel Zak d03dd60840 Imported from util-linux-2.12a tarball. 2006-12-07 00:26:14 +01:00
Karel Zak df1dddf9ff Imported from util-linux-2.12 tarball. 2006-12-07 00:26:12 +01:00
Karel Zak a5a16c6853 Imported from util-linux-2.11y tarball. 2006-12-07 00:26:08 +01:00
Karel Zak 24f4bbff7f Imported from util-linux-2.11w tarball. 2006-12-07 00:26:03 +01:00
Karel Zak 0e6f4a203d Imported from util-linux-2.11v tarball. 2006-12-07 00:26:02 +01:00
Karel Zak f0c8eda12c Imported from util-linux-2.11u tarball. 2006-12-07 00:26:00 +01:00
Karel Zak 63cccae468 Imported from util-linux-2.11t tarball. 2006-12-07 00:25:58 +01:00
Karel Zak 1d4ad1decc Imported from util-linux-2.11q tarball. 2006-12-07 00:25:54 +01:00
Karel Zak ffc4374869 Imported from util-linux-2.11o tarball. 2006-12-07 00:25:53 +01:00
Karel Zak e8f2641919 Imported from util-linux-2.11m tarball. 2006-12-07 00:25:49 +01:00
Karel Zak 364cda4857 Imported from util-linux-2.11f tarball. 2006-12-07 00:25:48 +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 726f69e29c Imported from util-linux-2.5 tarball. 2006-12-07 00:25:33 +01:00
Karel Zak 6dbe3af945 Imported from util-linux-2.2 tarball. 2006-12-07 00:25:32 +01:00