Commit Graph

97 Commits

Author SHA1 Message Date
rillig 0d42f426f1 cat: repeat storage class 'static' for local functions
No binary change.
2023-12-10 15:31:53 +00:00
rillig 7a4b38d710 cat: reduce visibility of local functions
No functional change.
2023-12-07 20:02:07 +00:00
rillig f00c946f6d cat: fix misleading indentation
Found by indent, but not by GCC 10.

No binary change.
2023-05-19 05:28:54 +00:00
wiz cb8c8a822a Add cross reference to tac(1). 2017-10-02 08:24:17 +00:00
wiz 39b251a71c Use Ex. 2017-07-04 06:46:51 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
sevan 9edf879ce4 When invoked with -se, print a '$' on blank lines
Obtained from OpenBSD r1.13 of src/bin/cat/cat.c

Closes PR bin/51250
Reviewed by Christos@
2016-06-16 00:52:37 +00:00
sevan f3ad9a4c7a Revert previous change made by me in r1.55 2016-06-16 00:45:37 +00:00
sevan bf748072f6 Drop the case '?' which is defined after case 'default'.
case 'default' statement introduced in the last commit to cat.c in the CSRG archive.
Obtained from OpenBSD bin/cat/cat.c r1.3.
2015-07-25 16:17:01 +00:00
wiz a5aae24aeb Bump date for previous. 2014-06-15 07:27:22 +00:00
dbj 2b213458d4 update list of flags which are extensions to the specification 2014-06-15 07:00:24 +00:00
spz 7ae9a70dc6 more complete fix for Coverity issue 976653 2013-12-08 08:32:13 +00:00
spz 78fc912d0b Coverity complaint fixes:
bin/cat/cat.c 976654 Argument cannot be negative
                     (missing check for fileno result, stdout)
bin/cat/cat.c 976653 Improper use of negative value
                     (missing check for fileno result, stdin)
2013-12-03 17:06:51 +00:00
christos 9638719987 only allocate if it would not fit in our buffer. 2012-11-19 19:41:31 +00:00
christos c25982c7d1 fix bogus warning for zero-sized files. 2012-11-19 19:34:03 +00:00
wiz baebe9d053 Sync usage with man page. 2012-11-10 18:42:22 +00:00
wiz c6d7976845 Sort options (no-argument ones first, then argument-taking ones). 2012-11-10 18:41:10 +00:00
christos 0002c266f0 Add an option to read with a different buffer size, and document the
buffer size we use. This allows us to cat -B 10000000 /proc/<pid>/maps
for example which cannot handle seeking.
2012-11-10 16:18:41 +00:00
dholland 2a71916f89 Use "e.g.", not "i.e.", to introduce an example. 2012-08-09 07:26:28 +00:00
wiz a036920a7d Describe behaviour when no arguments are given.
Add comma.
Bump date.

From Bug Hunting.
2012-04-06 11:42:08 +00:00
christos 0e2492e23b fix signed blksize_t lossage. 2012-03-17 23:35:28 +00:00
lukem 2fe2731d3f Remove the \n and tabs from the __COPYRIGHT() strings. 2008-07-20 00:52:39 +00:00
cbiere 555693c1aa - Applied patch from PR bin/35408 by Andreas Wiese.
- Use EXIT_FAILURE instead of 1.
 - Use return instead of exit() at the end of main().
 - Use sizeof() instead of BUFSIZ.
2007-01-13 11:51:59 +00:00
elad 93bbf8101f PR/32759: Ulrich Heilmann: Output of cat -s -n is wrong
Applied patch from David A. Holland, thanks!
2006-10-08 21:52:56 +00:00
wiz 0331d1430a Use macro for HTML output. 2006-09-23 11:24:44 +00:00
elad acd3797c82 PR/16827: Giorgos Keramidas: addition of EXAMPLES section to
basesrc/bin/cat.1
Applied patch, thanks!
2006-09-23 00:01:39 +00:00
christos cde6642bee PR/32931: Johan Veenhuizen: cat(1) does not clear the EOF indicator for
stdin in cooked mode.
2006-02-26 19:44:24 +00:00
jschauma 4f80cb6337 Remove unused code left over from temporary printescaped functionality.
Noted by Jeff Ito in PR bin/23966.
2004-01-04 03:31:28 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
jschauma 6a75fbb636 Following private discussion with kleink@ and hubertf@ and public discussion
on tech-userlevel@, back out printescaped() functionality.
kleink: ``We sell rope.''
2003-09-14 19:20:16 +00:00
uwe 9267b09572 Include "config.h" if building as a host program.
Need this to get SIZE_MAX defintion from compat_defs.h on FreeBSD.
2003-08-27 18:36:19 +00:00
junyoung 523866566b Add missing "." 2003-08-27 16:27:35 +00:00
kleink aeaabe9fa8 This is a host tool, so for the time being change SIZE_T_MAX to the
more portable SIZE_MAX; partially addresses PR toolchain/22504 from
Christian Limpach.
2003-08-25 16:38:55 +00:00
itojun e1e0321817 use bounded string op 2003-08-13 02:51:20 +00:00
agc b5b2954259 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22249, verified by myself.
2003-08-07 09:05:01 +00:00
jschauma 458ed23412 As discusses a little while back on tech-userlevel:
If stdout is a tty, use vis(3) to print any filenames to prevent garbage
from being printed if the filename contains control- or other non-printable
characters.

While here, sprinkle some EXIT_FAILURE and NOTREACHED where appropriate.
2003-08-04 22:31:21 +00:00
lukem 826a14607a Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
2003-05-18 07:57:31 +00:00
wiz 14dfaa4b03 New policy: New sentences start on a new line.
Patches by Robert Elz <kre at munnari oz au>, with minimal changes by me.
2002-09-25 15:18:36 +00:00
thorpej 42321e369a Don't use MAX(); not all systems have it, and this is a host tool. 2002-09-13 18:07:52 +00:00
enami fa2d3031e1 The el option is an extention. 2002-07-03 01:27:23 +00:00
bjh21 4a9e799f0d Rather than (ab)using the standard error message for EFTYPE, print our own
message when "cat -f" is used on a non-regular file.  This is necessary to
make cat(1) portable to systems that don't have EFTYPE (like Linux).
2002-06-11 22:05:07 +00:00
bjh21 06cc08da90 Only use __RCSID() and __COPYRIGHT() if they're defined. 2002-06-11 22:01:30 +00:00
mason aa8bdf5f50 Add wrapper around bsd.prog.mk include in preparation for this becoming a
host tool.
2002-06-10 18:31:12 +00:00
mason ec4fb122bd Add -l option to cat(1), as discussed on tech-userlevel. This option
causes cat(1) to use fcntl(2) to set an exclusive advisory lock on stdout.
While being useful in its own right, this will shortly be used to
guarantee orderly writing to METALOG in the case of unprivileged builds
with NBUILDJOBS > 1.
2002-06-10 07:43:33 +00:00
kleink 31f7fb4902 Consistent wording: `regular' files, not `plain' ones; from Giorgos
Keramidas in PR bin/16824.
2002-05-15 06:52:54 +00:00
simonb f1a6122c11 Simplify previous - sbuf.st_blksize is a uint32_t, so just use
bsize = MAX(sbuf.st_blksize, BUFSIZ);
and skip playing with SSIZE_MAX altogether.
2002-05-09 02:19:42 +00:00
thorpej f8b11571bb Fix oversight in last. 2002-05-09 02:13:10 +00:00
thorpej 2ee7baad55 Skip a check that is always true if _LP64 is defined. 2002-05-09 02:07:38 +00:00
ross dc5571b22e Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:21:55 +00:00
wiz 94eea247e1 Sort sections, drop unnecessary .Pps. 2001-12-20 20:01:15 +00:00