X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/6294d633e80db8e89697db796e6f6025d5af0cae..ad7871609881e73855d0b04da49b486cd93efca7:/usr/src/usr.bin/ex/ex_io.c diff --git a/usr/src/usr.bin/ex/ex_io.c b/usr/src/usr.bin/ex/ex_io.c index 9fd0a7234e..d38a67363a 100644 --- a/usr/src/usr.bin/ex/ex_io.c +++ b/usr/src/usr.bin/ex/ex_io.c @@ -1,12 +1,14 @@ /*- - * Copyright (c) 1980 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1980, 1993 + * The Regents of the University of California. All rights reserved. * - * %sccs.include.proprietary.c% + * This module is believed to contain source code proprietary to AT&T. + * Use and redistribution is subject to the Berkeley Software License + * Agreement and your Software Agreement with AT&T (Western Electric). */ #ifndef lint -static char sccsid[] = "@(#)ex_io.c 7.20 (Berkeley) %G%"; +static char sccsid[] = "@(#)ex_io.c 8.1 (Berkeley) 6/9/93"; #endif /* not lint */ #include "ex.h" @@ -417,6 +419,10 @@ rop(c) error(" Directory"); case S_IFREG: +#ifdef CRYPT + if (xflag) + break; +#endif i = read(io, (char *)&head, sizeof(head)); (void)lseek(io, 0L, L_SET); if (i != sizeof(head)) @@ -834,6 +840,18 @@ getfile() } return (EOF); } +#ifdef CRYPT + if (kflag) { + fp = genbuf; + while(fp < &genbuf[ninbuf]) { + if (*fp++ & 0200) { + crblock(perm, genbuf, ninbuf+1, + cntch); + break; + } + } + } +#endif fp = genbuf; cntch += ninbuf+1; } @@ -891,6 +909,10 @@ int isfilter; for (;;) { if (--nib < 0) { nib = fp - genbuf; +#ifdef CRYPT + if(kflag && !isfilter) + crblock(perm, genbuf, nib, cntch); +#endif if (write(io, genbuf, nib) != nib) { wrerror(); } @@ -905,6 +927,10 @@ int isfilter; } } while (a1 <= addr2); nib = fp - genbuf; +#ifdef CRYPT + if(kflag && !isfilter) + crblock(perm, genbuf, nib, cntch); +#endif if (write(io, genbuf, nib) != nib) { wrerror(); }