WARNSify, fix .Nm usage

This commit is contained in:
lukem 1997-10-18 14:45:55 +00:00
parent 397a8a0855
commit 95737fee5b
2 changed files with 18 additions and 17 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: expand.1,v 1.3 1995/09/02 06:19:45 jtc Exp $
.\" $NetBSD: expand.1,v 1.4 1997/10/18 14:45:55 lukem Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@ -41,7 +41,7 @@
.Nm unexpand
.Nd expand tabs to spaces, and vice versa
.Sh SYNOPSIS
.Nm expand
.Nm
.Op Fl Ns Ar tabstop
.Op Fl Ns Ar tab1,tab2,...,tabn
.Ar
@ -49,12 +49,12 @@
.Op Fl a
.Ar
.Sh DESCRIPTION
.Nm Expand
.Nm
processes the named files or the standard input writing
the standard output with tabs changed into blanks.
Backspace characters are preserved into the output and decrement
the column count for tab calculations.
.Nm Expand
.Nm
is useful for pre-processing character files
(before sorting, looking at specific columns, etc.) that
contain tabs.
@ -67,7 +67,7 @@ spaces apart instead of the default 8.
If multiple tabstops are given then the tabs are set at those
specific columns.
.Pp
.Nm Unexpand
.Nm unexpand
puts tabs back into the data from the standard input or the named
files and writes the result on the standard output.
.Pp
@ -84,6 +84,6 @@ resultant file by replacing two or more characters.
.El
.Sh HISTORY
The
.Nm expand
.Nm
command appeared in
.Bx 3.0 .

View File

@ -1,4 +1,4 @@
/* $NetBSD: expand.c,v 1.5 1995/09/02 06:19:46 jtc Exp $ */
/* $NetBSD: expand.c,v 1.6 1997/10/18 14:45:57 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@ -33,17 +33,17 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)expand.c 8.1 (Berkeley) 6/9/93";
#endif
static char rcsid[] = "$NetBSD: expand.c,v 1.5 1995/09/02 06:19:46 jtc Exp $";
__RCSID("$NetBSD: expand.c,v 1.6 1997/10/18 14:45:57 lukem Exp $");
#endif /* not lint */
#include <stdio.h>
@ -57,16 +57,17 @@ static char rcsid[] = "$NetBSD: expand.c,v 1.5 1995/09/02 06:19:46 jtc Exp $";
int nstops;
int tabstops[100];
static void getstops();
static void usage();
static void getstops __P((char *));
int main __P((int, char **));
static void usage __P((void));
int
main(argc, argv)
int argc;
char *argv[];
{
register int c, column;
register int n;
int c, column;
int n;
/* handle obsolete syntax */
while (argc > 1 && argv[1][0] && isdigit(argv[1][1])) {
@ -151,9 +152,9 @@ main(argc, argv)
static void
getstops(cp)
register char *cp;
char *cp;
{
register int i;
int i;
nstops = 0;
for (;;) {