* Copyright (c) 1989 The Regents of the University of California.
* %sccs.include.redist.c%
"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
static char sccsid
[] = "@(#)vis.c 5.1 (Berkeley) %G%";
int eflags
, fold
, foldwidth
=80, none
, markeol
, debug
;
while ((ch
= getopt(argc
, argv
, "nwctsobfF:ld")) != EOF
)
if ((foldwidth
= atoi(optarg
))<5) {
"vis: can't fold lines to less than 5 cols\n");
fold
++; /* fold output lines to 80 cols */
break; /* using hidden newline */
markeol
++; /* mark end of line with \$ */
"usage: vis [-nwctsobf] [-F foldwidth]\n");
if ((fp
=fopen(*argv
, "r")) != NULL
)
fprintf(stderr
, "vis: %s: %s\n", *argv
,
(char *)strerror(errno
));
process(stdin
, "<stdin>");
register char *cp
= "\0"+1; /* so *(cp-1) starts out != '\n' */
} else if (markeol
&& c
== '\n') {
if ((eflags
& VIS_NOSLASH
) == 0)
(void) vis(buff
, (char)c
, eflags
, (char)rachar
);
col
= foldit(cp
, col
, foldwidth
);
* terminate partial line with a hidden newline
if (fold
&& *(cp
-1) != '\n')