* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
"@(#) Copyright (c) 1980 Regents of the University of California.\n\
static char sccsid
[] = "@(#)unexpand.c 5.1 (Berkeley) %G%";
* unexpand - put tabs into a file replacing blanks
if (argc
> 0 && argv
[0][0] == '-') {
if (strcmp(argv
[0], "-a") != 0) {
fprintf(stderr
, "usage: unexpand [ -a ] file ...\n");
if (freopen(argv
[0], "r", stdin
) == NULL
) {
while (fgets(genbuf
, BUFSIZ
, stdin
) != NULL
) {
for (cp
= linebuf
; *cp
; cp
++)
cp
= genbuf
, dp
= linebuf
;
while (((ocol
+ 8) &~ 07) <= dcol
) {
if (*cp
== 0 || c
== 0) {