Commit Graph

30 Commits

Author SHA1 Message Date
dholland
420b514ac8 Remove insane centering code (that broke on strings of length 1) and
replace it with sane centering code. Fixes PR bin/38209, although with
a different patch.
2008-04-13 03:46:30 +00:00
christos
bb0b4504cd PR/38207: Aleksej Saushev: fmt reports non-existing files erroneously 2008-03-09 17:26:37 +00:00
perry
8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
christos
c3f4be5b97 make sure we have args before we try to parse numbers in the compat argument
parsing. From Gary Duzan
2007-06-03 22:39:21 +00:00
christos
3d9ab41d78 - getopt parsing
- add raw mode [-r]
- add -g and -m to get the goal and max respectively.
- document that lines that start with a period or look like mail headers
  don't get formatted.
2007-05-29 15:27:37 +00:00
christos
9ebf619229 fix trailing blank munging. 2006-01-15 14:41:45 +00:00
christos
bd35911685 revert the line calculation as it used to be pre-buffer changes. 2006-01-15 14:26:10 +00:00
christos
68e618cea2 more casts to void 2006-01-05 02:07:29 +00:00
christos
e4a41ed570 fix problem introduced when the computation was changed to unsigned. If
we've exceeded the goal length already the negative number turned into
a large positive one...
2006-01-04 20:44:57 +00:00
christos
630ea70860 use putchar consistently. 2005-12-16 04:20:09 +00:00
christos
75bdcdea65 small cleanups from seebs... 2005-12-15 22:37:37 +00:00
christos
9ac95763b7 PR/32305: seebs: Eliminate buffer overflows and simplify code by using
dynamically allocated buffers.
2005-12-15 21:32:00 +00:00
dsl
43371ff1ac Add (unsigned char) cast to ctype functions 2004-10-30 17:17:35 +00:00
agc
89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
wiz
482ca46625 ANSIfy, minor KNF. 2002-03-02 13:55:13 +00:00
abs
772b3f392d Tweak last to only allow highbit characters >=160, to avoid issues with
characters 128 + 0..31
2000-10-02 18:32:55 +00:00
abs
3a7a808464 Do not strip highbit characters. 2000-10-02 18:31:48 +00:00
abs
75155d4d12 Switch centre to -C from -c. Now different from FreeBSD, but avoids conflict
with Solaris, Linux and others.
2000-09-18 13:42:53 +00:00
abs
ef12b8c845 Add '-c' for center (from FreeBSD) 2000-09-15 11:23:17 +00:00
jwise
768d7ab7a9 GC savestr() function. Makes this build again on i386 (this hadn't been used
for a while, but showed up due to recent static poisoning.)  Note that although
fmt.c builds against ../mail/head.c, this function never actually gets used.
1999-11-02 21:17:16 +00:00
jdolecek
5f8283ea12 process correctly whole line even when it's longer than BUFSIZ characters -
previously, all characters of a line after the first BUFSIZ characters
	were just trimmed
while here, do some const & static poisoning
1999-11-02 12:50:04 +00:00
christos
489005fa65 char -> unsigned char 1998-12-19 16:01:21 +00:00
ross
f288e985a1 abs() numeric parameters to allow portable invocations in scripts. 1998-02-12 21:11:00 +00:00
lukem
6533f941fe s/index/strchr 1997-10-18 15:01:05 +00:00
lukem
0c2c736d5a WARNSify, fix .Nm usage 1997-10-18 15:00:11 +00:00
kleink
86d80fb61d Determine characters to be swallowed by means of locale and ctype.
This addresses PR/3693 from Jaromir Dolecek <dolecek@moria.ics.muni.cz> but
does not really fix it, as the new ctype package has yet to be integrated.
1997-05-31 15:13:49 +00:00
jtc
7642736cd5 Sync with 4.4lite2 1995-09-01 01:29:39 +00:00
cgd
55d8a77f2c pull in stdlib.h and string.h, kill unnecessary declaration. 1994-12-24 16:35:17 +00:00
mycroft
e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
cgd
61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00