OpenBSD CVS

CVS log for src/usr.bin/fmt/fmt.c


[BACK] Up to [local] / src / usr.bin / fmt

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.39 / (download) - annotate - [select for diffs], Thu Oct 18 05:04:52 2018 UTC (5 years, 7 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, HEAD
Changes since 1.38: +7 -7 lines
Diff to previous 1.38 (colored)

Fix not accounting for NUL for allocation size and move to reallocarray
while there.  ok deraadt@ millert@

Revision 1.38 / (download) - annotate - [select for diffs], Mon Feb 20 15:48:00 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.37: +52 -46 lines
Diff to previous 1.37 (colored)

* Hoist Copyright notice to the top, don't hide it in the middle.
* Add Copyright and license for my changes, and for pjanzen@'s in 2000.
* Comply with the obnoxious license condition that we must list changes
in the source code.
* Delete a fragment of an ancient RCS change log listing changes by
Gareth McCaughan himself.  The license does NOT require us to keep that,
and it does not contain interesting information, not even for historians.

OK pjanzen@ deraadt@

Revision 1.37 / (download) - annotate - [select for diffs], Sun Feb 19 23:45:46 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Do not break the line at U+00A0 NO-BREAK SPACE.
Bug pointed out by Eric dot Pruitt at gmail dot com on misc@.
OK millert@ bentley@

Revision 1.36 / (download) - annotate - [select for diffs], Thu Jan 7 18:02:43 2016 UTC (8 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.35: +22 -6 lines
Diff to previous 1.35 (colored)

UTF-8 support for fmt -c.

This implies two small changes in behaviour:
1. Let fmt -c replace invalid bytes with ASCII question marks
just like when called without -c.
2. On lines to be centered, replace each tab with a single blank,
simply because there is no useful way to define the meaning of a
tab on such a line.  Having the width of a tab depend on what is
to the right of it would be completely crazy (and complicate the
code a lot), and otherwise, tabs on adjacent lines of different
length wouldn't align anyway.

OK millert@

Revision 1.35 / (download) - annotate - [select for diffs], Thu Dec 31 16:10:31 2015 UTC (8 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.34: +4 -5 lines
Diff to previous 1.34 (colored)

Remove use of sysexits.h.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Dec 15 16:26:17 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.33: +115 -124 lines
Diff to previous 1.33 (colored)

UTF-8 support; does not yet handle the -c option.
No longer expand tabs up front in get_line(), their width depends on the
width of characters earlier on the line.  Always NUL-terminate the input
buffer for easier and safer handling.  Get rid of the hand-rolled output
buffer, just let stdio do its work.
OK tedu@

Revision 1.33 / (download) - annotate - [select for diffs], Fri Oct 9 01:37:07 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.32: +5 -5 lines
Diff to previous 1.32 (colored)

Change all tame callers to namechange to pledge(2).

Revision 1.32 / (download) - annotate - [select for diffs], Mon Oct 5 06:21:15 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

use the normal -1 check for tame failure

Revision 1.31 / (download) - annotate - [select for diffs], Mon Oct 5 06:17:05 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.30: +6 -1 lines
Diff to previous 1.30 (colored)

tame "stdio rpath" is enough for the general case, which opens file
after file from argv.  If it is discovered to be reading from stdin only,
go to tame "stdio"
ok doug

Revision 1.30 / (download) - annotate - [select for diffs], Tue Nov 26 13:18:55 2013 UTC (10 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.29: +7 -7 lines
Diff to previous 1.29 (colored)

unsigned char casts for ctype
ok krw

Revision 1.29 / (download) - annotate - [select for diffs], Tue Jan 17 04:26:28 2012 UTC (12 years, 4 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.28: +6 -5 lines
Diff to previous 1.28 (colored)

Change the exit value on errors to be more 4.4BSD like. Use the sum of
errors up to a maximum of 127, then to do not increment anymore,
though programme execution continues.

Use 127 as a maximum because error codes above this are:

1. bad because of signed bugs in programs.
2. used as the traditional shell $? representation of "kill by signal"
   where $? = 128 + signal.

(from deraadt@ and guenther@ respectively)

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jan 15 11:43:45 2012 UTC (12 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

Document the EXIT STATUS and remove an outdated related comment.

While here,
* as usual, the "first appeared" clause requires fixing, and
* mention the date of the original implementation,
using information from the CSRG archive CD 1.

Triggered by a question asked by lum@, feedback and ok jmc@.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:38 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.26: +1 -8 lines
Diff to previous 1.26 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.26 / (download) - annotate - [select for diffs], Tue Mar 20 03:50:39 2007 UTC (17 years, 2 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

remove some bogus *p tests from charles longeau
ok deraadt millert

Revision 1.25 / (download) - annotate - [select for diffs], Wed Nov 29 21:59:04 2006 UTC (17 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.24: +5 -14 lines
Diff to previous 1.24 (colored)

trim usage(); ok millert deraadt

Revision 1.24 / (download) - annotate - [select for diffs], Wed Nov 29 20:09:27 2006 UTC (17 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

- sync synopsis and usage()
- sort options
- avoid line split

Revision 1.23 / (download) - annotate - [select for diffs], Tue Mar 8 23:34:43 2005 UTC (19 years, 2 months ago) by cloder
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.22: +5 -5 lines
Diff to previous 1.22 (colored)

weeping the tree for printf(s) where printf("%s",s) should be used.
This is a regression introduced during conversion from perror(3) to err(3)
OK mickey@

Revision 1.22 / (download) - annotate - [select for diffs], Tue Jun 29 16:59:46 2004 UTC (19 years, 10 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.21: +9 -9 lines
Diff to previous 1.21 (colored)

use warn() instead of perror; err*() are used already

Revision 1.21 / (download) - annotate - [select for diffs], Thu Apr 1 23:14:19 2004 UTC (20 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.20: +440 -343 lines
Diff to previous 1.20 (colored)

knf and ansi, mostly from joris vink

Revision 1.20 / (download) - annotate - [select for diffs], Mon Dec 1 15:34:26 2003 UTC (20 years, 5 months ago) by grange
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

Format string fixes from art's amd64 tree.
ok rohee@ espie@

Revision 1.19 / (download) - annotate - [select for diffs], Thu Nov 29 00:33:06 2001 UTC (22 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.18: +20 -4 lines
Diff to previous 1.18 (colored)

Restore historic behavior:
 o don't fmt lines that start with '.' to avoid hosing *roff
 o add -n flag to disable above behavior (undocumented feature in old fmt)
Patch from Ruslan Ermilov (FreeBSD)

Revision 1.18 / (download) - annotate - [select for diffs], Wed Nov 28 22:01:42 2001 UTC (22 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.17: +26 -63 lines
Diff to previous 1.17 (colored)

from FreeBSD:
Some KNF
Call setlocale()
Remove some silliness for non-BSD systems

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jul 12 05:17:05 2001 UTC (22 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

first pass at a -Wall cleanup

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jun 25 15:35:42 2000 UTC (23 years, 10 months ago) by pjanzen
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.15: +28 -6 lines
Diff to previous 1.15 (colored)

allow 'fmt -w width' and 'fmt -width'.
ok millert@

Revision 1.15 / (download) - annotate - [select for diffs], Thu Dec 30 18:00:42 1999 UTC (24 years, 4 months ago) by provos
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

dont strip off international characters; fixes pr/1020

Revision 1.14 / (download) - annotate - [select for diffs], Wed Dec 15 05:34:33 1999 UTC (24 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

safe strcpy

Revision 1.13 / (download) - annotate - [select for diffs], Mon Dec 14 21:50:32 1998 UTC (25 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

adjust argv and argc correctly when reading max from command line

Revision 1.12 / (download) - annotate - [select for diffs], Mon Dec 14 21:48:10 1998 UTC (25 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

pasto that caused goal and max params not to work

Revision 1.11 / (download) - annotate - [select for diffs], Sat Apr 25 23:07:16 1998 UTC (26 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

getopt(3) returns -1 on end of args, not EOF.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Apr 25 23:02:28 1998 UTC (26 years ago) by millert
Branch: MAIN
Changes since 1.9: +606 -575 lines
Diff to previous 1.9 (colored)

fmt(1) rewrite by Gareth McCaughan.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Feb 16 07:54:29 1998 UTC (26 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.8: +4 -4 lines
Diff to previous 1.8 (colored)

use abs() on the width for compat with other versions of fmt that accept -width; ross

Revision 1.8 / (download) - annotate - [select for diffs], Wed Oct 1 15:31:03 1997 UTC (26 years, 7 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

Fix bug where fmt allows backslashed whitespace inside words, but it only
counts each such as one character long, gjm11@dpmms.cam.ac.uk.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Sep 23 11:54:00 1997 UTC (26 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +6 -2 lines
Diff to previous 1.6 (colored)

avoid crash when dealing with ^M lines; roberte@MEP.Ruhr-Uni-Bochum.de

Revision 1.6 / (download) - annotate - [select for diffs], Sat Feb 8 10:23:39 1997 UTC (27 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

inline to avoid warning

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jan 27 04:06:49 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.4: +65 -27 lines
Diff to previous 1.4 (colored)

No more static buffers.  We can operate on any sized files now.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Jan 26 03:56:52 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.3: +118 -37 lines
Diff to previous 1.3 (colored)

Dynamic buffering to handle arbitrary line length and center option from FreeBSD
I also cleaned it up to pass -Wall and check malloc().

Revision 1.3 / (download) - annotate - [select for diffs], Fri Jan 17 07:12:35 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

r?index -> strr?chr

Revision 1.2 / (download) - annotate - [select for diffs], Wed Jun 26 05:33:21 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

rcsid

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:45:15 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:45:15 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.