Commit graph

22 commits

Author SHA1 Message Date
Dag-Erling Smørgrav bc2913d173 bintrans: Remove unused variable.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D43559
2024-02-01 14:10:45 +01:00
Dag-Erling Smørgrav 64028ac3ba bintrans: Add base64 to name list in manual page.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	0mp, pstef
Differential Revision:	https://reviews.freebsd.org/D43558
2024-02-01 14:10:41 +01:00
Dag-Erling Smørgrav bce34cba07 bintrans: Fix uninitialized variable.
`prev` may be used uninitialized if `body` starts with a newline.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	bapt, emaste
Differential Revision:	https://reviews.freebsd.org/D43534
2024-02-01 14:10:37 +01:00
Dag-Erling Smørgrav 5cb28f7979 bintrans: Error out if writing to the output failed.
- Cover all code paths.
- When decoding, check all output files, not just the last one.
- A simple `ferror()` check is not enough as an error may later occur
  while flushing whatever remains in the output buffer.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D43532
2024-02-01 14:10:31 +01:00
Warner Losh 0b8224d1cc Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by:		Netflix
2023-11-26 22:23:58 -07:00
Warner Losh bdcbfde31e usr.bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:30 -07:00
Warner Losh b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Alfonso Gregory 498a0a9c61 Mark usage function as __dead2 in programs where it does not return
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
2023-07-07 10:45:18 -06:00
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Baptiste Daroussin 83e8c23178 bintrans: replace the quoted printable encoder/decoder
Replace the quoted printable code with one that respects RFC2045
Add tests about this parsers and encoders, using examples from the
wikipedia page.

Reviewed by:	pstef
Differential Revision: https://reviews.freebsd.org/D36314
2022-08-25 09:29:18 +02:00
Piotr Pawel Stefaniak ed016aa435 base64: ignore -i as promised 2022-04-24 08:23:27 +02:00
Piotr Pawel Stefaniak aad4fd5495 Add a quoted-printable encoder/decoder
As an example:
printf 'We don=27t know what to do with other=20worlds.=0D=0A' \
| bintrans qp -u

Differential Revision:	https://reviews.freebsd.org/D34933

Reviewed by:	debdrup (manpage)
2022-04-24 08:20:27 +02:00
Piotr Pawel Stefaniak ff2b1ffbb0 bintrans: adjust mmencode.c to style(9) 2022-04-24 08:19:49 +02:00
Piotr Pawel Stefaniak 9d68da4ee8 bintrans: make mmencode.c compilable
Also remove MSDOS code, base64 code and commented out code.
2022-04-24 08:19:48 +02:00
Piotr Pawel Stefaniak 8a65b02dac bintrans: import mmencode.c for quoted-printable en/de-coding
This is a preliminary commit in preparation for exposing
a quoted-printable encoder and decoder through the new command bintrans.
2022-04-24 08:19:48 +02:00
Piotr Pawel Stefaniak 540a99289b Add the base64 command using b64encode and b64decode
Various scripts expect the base64 command to be present. We've had the
code and it's been exposed as b64encode/b64decode, but it wasn't widely
known under these names and the syntax is much different.

Reviewed by:	delphij
Differential Revision:	https://reviews.freebsd.org/D32945
2022-04-18 13:53:59 +02:00
Piotr Pawel Stefaniak 2ad786c63a b64encode: implement -w to wrap lines
This functionality is present in GNU base64 and I find it useful when
I want to generate random, ASCII-clean data of specific width.

Reviewed by:	delphij
Differential Revision:	https://reviews.freebsd.org/D32944
2022-04-18 13:53:58 +02:00
Piotr Pawel Stefaniak f331cf9b04 bintrans: reinstate a test case that I lost
Reported by:	https://ci.freebsd.org/job/FreeBSD-main-amd64-test/21166
2022-04-18 13:53:58 +02:00
Piotr Pawel Stefaniak 47bcbde91d bintrans: move files to a new directory
And reflect the change in various places.
2022-04-18 10:53:11 +02:00