History log of /freebsd-current/usr.bin/asa/asa.c
Revision Date Author Comments
# c2356a44 09-Jan-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

asa: Rewrite to fix line termination issue.

The standard is somewhat unclear, but on the balance, I believe that the
phrase “the rest of the input line” should be interpreted to mean the
rest of the input line including the terminating newline if and only if
there is one. This means the current implementation is incorrect on two
points:

- First, it suppresses the previous line's newline in the '1' case.

- Second, it unconditionally emits a newline at the end of the output
for non-empty input, even if the input did not end with a newline.

Resolve this by rewriting the main loop. Instead of special-casing the
first line and then assuming that every line ends with a newline, we
remember how each line ends and emit that either at the beginning of
the next line or at the end of the file except in the one case ('+')
where the standard explicitly says not to.

While here, try to reduce diff to upstream a little and update their
RCS tag to reflect the fact that while we've diverged significantly
from them, we've incorporated all their changes. Remove the useless
second RCS tag.

We also update the tests to account for the change in interpretation
of the '1' case and add a test case for unterminated input.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43326


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 498a0a9c 07-Jul-2023 Alfonso Gregory <gfunni234@gmail.com>

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


# f08f90e6 15-Jun-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

asa: Read from stdin if *argv is "-".

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D40563


# 9e379f96 15-Jun-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

asa: Error out if writing to stdout failed.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D40562


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# f682f10c 21-May-2005 Ruslan Ermilov <ru@FreeBSD.org>

Sync program's usage() with manpage's SYNOPSIS.


# a3778ff6 14-May-2002 Tim J. Robbins <tjr@FreeBSD.org>

#include <unistd.h> for getopt() and friends.

PR: 36130
Approved by: mike


# 66562e1a 14-May-2002 Tim J. Robbins <tjr@FreeBSD.org>

Use getopt() to reject options (asa has none), and to the "--" end of options
marker. Exit non-zero if we cannot open one of the input files. Update
standards conformance and exit status statements in manual page.

PR: 36130
Approved by: mike


# 8a99cbd5 14-May-2002 Tim J. Robbins <tjr@FreeBSD.org>

Remove __P,
Don't prototype main(),
C89-style function declarations,
char **argv -> char *argv[] for main()

PR: 36130
Approved by: mike


# 81c126e7 14-May-2002 Tim J. Robbins <tjr@FreeBSD.org>

style(9): remove space between function name and opening parentheses,
sort variables, NULL is the null-pointer constant, remove unnecessary
braces.

PR: 36130
Approved by: mike


# 3990fae7 14-May-2002 Tim J. Robbins <tjr@FreeBSD.org>

Add the POSIX.2 asa utility, which interprets FORTRAN carriage-control
characters.

PR: 36130
Approved by: mike
Obtained from: NetBSD