#
60e87943 |
| 08-Feb-2022 |
cheloha <cheloha@openbsd.org> |
rev(1): drop "rpath" promise in no-file branch.
We don't need "rpath" if we're only processing the standard input.
Thread: https://marc.info/?l=openbsd-tech&m=164433848419371&w=2
ok deraadt@ mille
rev(1): drop "rpath" promise in no-file branch.
We don't need "rpath" if we're only processing the standard input.
Thread: https://marc.info/?l=openbsd-tech&m=164433848419371&w=2
ok deraadt@ millert@
show more ...
|
#
fc107d1d |
| 29-Jan-2022 |
cheloha <cheloha@openbsd.org> |
rev(1): refactor main loop
The main loop here is obfuscated.
Refactor the open/read/write/close portion of the loop out of main () and into a new function, rev_file(). Move "multibyte" out into gl
rev(1): refactor main loop
The main loop here is obfuscated.
Refactor the open/read/write/close portion of the loop out of main () and into a new function, rev_file(). Move "multibyte" out into global storage.
The result is much easier to understand at a glance.
Thread: https://marc.info/?l=openbsd-tech&m=164329515201417&w=2
ok millert@
show more ...
|
#
576410a5 |
| 13-Jan-2022 |
schwarze <schwarze@openbsd.org> |
Calling MB_CUR_MAX is much more expensive than incrementing a pointer and than testing and printing a byte, so do it once up front rather than inside the inner loop. This speeds up rev(1) by about a
Calling MB_CUR_MAX is much more expensive than incrementing a pointer and than testing and printing a byte, so do it once up front rather than inside the inner loop. This speeds up rev(1) by about a factor of three for typical use cases. Performance issue found by cheloha@, but my fix is a bit simpler and more rigorous than Scott's original patch.
While here, also add the missing handling for write errors (making them fatal, whereas read errors remain non-fatal and proceed to the next input file) and also avoid testing each byte twice, making the code more straightforward and more readable.
In part using ideas from millert@ and martijn@. OK martijn@.
show more ...
|
#
f0005cd0 |
| 10-Apr-2016 |
martijn <martijn@openbsd.org> |
Enable UTF-8 support in rev. Some minor cleanups while here.
OK schwarze@
|
#
0bd1216c |
| 09-Oct-2015 |
deraadt <deraadt@openbsd.org> |
Change all tame callers to namechange to pledge(2).
|
#
1f3479d0 |
| 07-Oct-2015 |
deraadt <deraadt@openbsd.org> |
tame "stdio rpath"
|
#
043fbe51 |
| 27-Oct-2009 |
deraadt <deraadt@openbsd.org> |
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 (th
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
show more ...
|
#
21504cd7 |
| 16-Mar-2007 |
jasper <jasper@openbsd.org> |
use __progname
ok otto@
|
#
2f9da20e |
| 30-Jul-2006 |
ray <ray@openbsd.org> |
Remove double variable assignment.
From Bret Lambert <bret dot lambert at gmail dot com>
OK krw@ and deraadt@.
|
#
1837a5ca |
| 10-Jun-2003 |
deraadt <deraadt@openbsd.org> |
mostly ansi cleanup; pval ok
|
#
f75387cb |
| 03-Jun-2003 |
millert <millert@openbsd.org> |
Remove the advertising clause in the UCB license which Berkeley rescinded 22 July 1999. Proofed by myself and Theo.
|
#
c72b5b24 |
| 16-Feb-2002 |
millert <millert@openbsd.org> |
Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be don
Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
show more ...
|
#
c0932ef1 |
| 19-Nov-2001 |
mpech <mpech@openbsd.org> |
kill more registers
millert@ ok
|
#
72799b18 |
| 15-Jan-1997 |
millert <millert@openbsd.org> |
getopt(3) returns -1 when out of args, not EOF, whee!
|
#
1258a77d |
| 26-Jun-1996 |
deraadt <deraadt@openbsd.org> |
rcsid
|
#
df930be7 |
| 18-Oct-1995 |
deraadt <deraadt@openbsd.org> |
initial import of NetBSD tree
|