Remove rzsz.

Thanks to FreeBSD for discovering that nasty little surprise...
This commit is contained in:
espie 2000-01-31 22:42:23 +00:00
parent 3aba63a66b
commit 67beead928
12 changed files with 1 additions and 782 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.14 2000/01/05 23:40:48 dugsong Exp $
# $OpenBSD: Makefile,v 1.15 2000/01/31 22:42:23 espie Exp $
# $FreeBSD: Makefile,v 1.27 1997/11/22 14:56:56 peter Exp $
#
@ -15,7 +15,6 @@
SUBDIR += minicom
SUBDIR += pilot-link
SUBDIR += qpage
SUBDIR += rzsz
SUBDIR += seyon
# SUBDIR += snooper
SUBDIR += tkhylafax

View File

@ -1,18 +0,0 @@
# $OpenBSD: Makefile,v 1.8 1999/11/30 07:57:48 kevlo Exp $
DISTNAME= rzsz
PKGNAME= rzsz-3.54
CATEGORIES= comms
MASTER_SITES= ftp://ftp.cs.pdx.edu/pub/zmodem/
NEED_VERSION= 1.91
NO_CDROM= "COMM: commercial software"
RESTRICTED= "This port is shareware"
MAINTAINER= kevlo@openbsd.org
NO_WRKSUBDIR= yes
USE_ZIP= yes
.include <bsd.port.mk>

View File

@ -1,37 +0,0 @@
LBIN_DIR=${PREFIX}/bin
LCAT_DIR=${PREFIX}/man/cat1
all:posix crc
posix:
$(CC) $(CFLAGS) -DPOSIX -DMD=2 rz.c -o rz
$(CC) $(CFLAGS) -DPOSIX sz.c -o sz
crc:
$(CC) $(CFLAGS) crc.c -o crc
install:
install -cs -o bin -g bin -m 755 rz $(LBIN_DIR)
ln -fs rz $(LBIN_DIR)/rx
ln -fs rz $(LBIN_DIR)/rb
ln -fs rz $(LBIN_DIR)/rc
install -cs -o bin -g bin -m 755 sz $(LBIN_DIR)
ln -fs sz $(LBIN_DIR)/sx
ln -fs sz $(LBIN_DIR)/sb
ln -fs sz $(LBIN_DIR)/zcommand
ln -fs sz $(LBIN_DIR)/zcommandi
install -cs -o bin -g bin -m 755 crc $(LBIN_DIR)
install -c -o bin -g bin -m 644 crc.doc $(LCAT_DIR)/crc.1
install -c -o bin -g bin -m 644 rz.doc $(LCAT_DIR)/rz.1
ln -fs rz.1 $(LCAT_DIR)/rx.1
ln -fs rz.1 $(LCAT_DIR)/rb.1
ln -fs rz.1 $(LCAT_DIR)/rc.1
install -c -o bin -g bin -m 644 sz.doc $(LCAT_DIR)/sz.1
ln -fs sz.1 $(LCAT_DIR)/sx.1
ln -fs sz.1 $(LCAT_DIR)/sb.1
ln -fs sz.1 $(LCAT_DIR)/zcommand.1
ln -fs sz.1 $(LCAT_DIR)/zcommandi.1
clean:
rm -f core* rz sz crc

View File

@ -1,3 +0,0 @@
MD5 (rzsz.zip) = 55b4578a63d07852698395522066fee1
RMD160 (rzsz.zip) = 396a80227226aab701a9844b8616dc5ad173fe46
SHA1 (rzsz.zip) = 2035758d00961a66ed3b4c210bc404576edbf02c

View File

@ -1,13 +0,0 @@
--- crc.c.orig Tue Nov 30 14:27:00 1999
+++ crc.c Tue Nov 30 14:27:32 1999
@@ -117,6 +117,10 @@
{
register errors = 0;
+ if(argc < 2) {
+ fprintf(stderr, "Usage: %s [-x] [-k] file ...\n", argv[0]);
+ exit(0);
+ }
if (! strcmp(argv[1], "-x")) {
Block = 128; --argc; ++argv;
}

View File

@ -1,181 +0,0 @@
--- rbsb.c.orig Tue Nov 30 14:28:16 1999
+++ rbsb.c Tue Nov 30 14:47:42 1999
@@ -17,8 +17,9 @@
#ifdef LLITOUT
long Locmode; /* Saved "local mode" for 4.x BSD "new driver" */
long Locbit = LLITOUT; /* Bit SUPPOSED to disable output translations */
-#include <strings.h>
#endif
+#include <strings.h>
+char *ttyname(), *getenv();
#endif
#ifdef USG
@@ -83,6 +84,7 @@
char *Nametty;
FILE *Ttystream;
+FILE *Logstream;
int Tty;
char linbuf[HOWMANY];
char xXbuf[BUFSIZ];
@@ -359,7 +361,7 @@
(void) tcflow(Tty, TCOON); /* Restart output */
#else
(void) ioctl(Tty, TCSBRK, 1); /* Wait for output to drain */
- (void) ioctl(Tty, TCFLSH, 1); /* Flush input queue */
+ (void) ioctl(Tty, TCFLSH, 0); /* Flush input queue */
(void) ioctl(Tty, TCSETAW, &oldtty); /* Restore modes */
(void) ioctl(Tty, TCXONC,1); /* Restart output */
#endif
@@ -371,6 +373,13 @@
#ifdef LLITOUT
ioctl(Tty, TIOCLSET, &Locmode);
#endif
+#ifdef TIOCFLUSH
+ { static int fread = 1;
+ ioctl(Tty, TIOCFLUSH, &fread); /* Flush input queue */
+ }
+#else
+ lseek(Tty, 0L, 2);
+#endif
#endif
return OK;
@@ -384,7 +393,6 @@
#ifdef V7
#ifdef TIOCSBRK
#define CANBREAK
- sleep(1);
ioctl(Tty, TIOCSBRK, 0);
sleep(1);
ioctl(Tty, TIOCCBRK, 0);
@@ -403,16 +411,13 @@
/* Initialize tty device for serial file xfer */
inittty()
{
- if ((Nametty = ttyname(2)) && *Nametty) {
- Tty = open(Nametty, 2);
- } else {
- Tty = open(Nametty = "/dev/tty", 2);
- }
-
- if (Tty <= 0) {
- perror(Nametty); exit(2);
- }
- Ttystream = fdopen(Tty, "w");
+ Tty = 0;
+ Ttystream = stdout;
+ Nametty = ttyname(Tty);
+ if (!Nametty || !*Nametty)
+ Nametty = "|pipe|";
+ Logstream = stderr;
+ setbuf(Ttystream, xXbuf);
}
flushmoc()
@@ -443,7 +448,7 @@
if (--Lleft >= 0) {
if (Verbose > 8) {
- fprintf(stderr, "%02x ", *cdq&0377);
+ fprintf(Logstream, "%02x ", *cdq&0377);
}
return (*cdq++ & 0377);
}
@@ -451,15 +456,12 @@
if (n < 2)
n = 2;
if (Verbose > 5)
- fprintf(stderr, "Calling read: alarm=%d Readnum=%d ",
+ fprintf(Logstream, "Calling read: alarm=%d Readnum=%d ",
n, Readnum);
if (setjmp(tohere)) {
-#ifdef TIOCFLUSH
-/* ioctl(Tty, TIOCFLUSH, 0); */
-#endif
- Lleft = 0;
+ purgeline();
if (Verbose>1)
- fprintf(stderr, "Readline:TIMEOUT\n");
+ fprintf(Logstream, "Readline:TIMEOUT\n");
return TIMEOUT;
}
signal(SIGALRM, alrm); alarm(n);
@@ -467,16 +469,16 @@
Lleft=read(Tty, cdq=linbuf, Readnum);
alarm(0);
if (Verbose > 5) {
- fprintf(stderr, "Read returned %d bytes errno=%d\n",
+ fprintf(Logstream, "Read returned %d bytes errno=%d\n",
Lleft, errno);
}
if (Lleft < 1)
return TIMEOUT;
if (Verbose > 8) {
for (n = Lleft; --n >= 0; ) {
- fprintf(stderr, "%02x ", *cdq&0377);
+ fprintf(Logstream, "%02x ", *cdq&0377);
}
- fprintf(stderr, "\n");
+ fprintf(Logstream, "\n");
}
--Lleft;
return (*cdq++ & 0377);
@@ -492,13 +494,44 @@
Lleft = 0;
#ifdef USG
#ifdef POSIX
- tcflush(Tty, 0);
+ tcflush(Tty, TCIFLUSH);
#else
ioctl(Tty, TCFLSH, 0);
#endif
#else
+#ifdef TIOCFLUSH
+ { static int fread = 1;
+ ioctl(Tty, TIOCFLUSH, &fread);
+ }
+#else
lseek(Tty, 0L, 2);
#endif
+#endif
+}
+
+/*
+ * Purge the modem output queue of all characters
+ */
+purgeout()
+{
+#ifdef __FreeBSD__
+ fpurge(Ttystream);
+#else
+ rewind(Ttystream);
+#endif
+#ifdef POSIX
+ tcflush(Tty, TCOFLUSH);
+#else
+#ifdef TCFLSH
+ ioctl(Tty, TCFLSH, 1);
+#else
+#ifdef TIOCFLUSH
+ {static int fwrite = 2;
+ ioctl(Tty, TIOCFLUSH, &fwrite);
+ }
+#endif
+#endif
+#endif
}
/*
@@ -531,8 +564,8 @@
long a, b, c, d;
{
if (Verbose > 2) {
- fprintf(stderr, f, a, b, c, d);
- fprintf(stderr, "\n");
+ fprintf(Logstream, f, a, b, c, d);
+ fprintf(Logstream, "\n");
}
}

View File

@ -1,211 +0,0 @@
--- rz.c.orig Tue Nov 30 14:44:57 1999
+++ rz.c Tue Nov 30 15:48:37 1999
@@ -132,9 +132,8 @@
static char canistr[] = {
24,24,24,24,24,24,24,24,24,24,0
};
-
+ purgeline(); /* Do read next time ... */
zmputs(canistr);
- Lleft=0; /* Do read next time ... */
}
/*
@@ -185,6 +184,7 @@
char ztrans; /* ZMODEM file transport request */
int Zctlesc; /* Encode control characters */
int Zrwindow = 1400; /* RX window size (controls garbage count) */
+int log_to_screen = 0; /* Don't make log file */
/*
* Log an error
@@ -195,9 +195,9 @@
{
if (Verbose <= 0)
return;
- fprintf(stderr, "Retry %d: ", errors);
- fprintf(stderr, s);
- fprintf(stderr, "\n");
+ fprintf(Logstream, "Retry %d: ", errors);
+ fprintf(Logstream, s);
+ fprintf(Logstream, "\n");
}
void
@@ -234,7 +234,7 @@
if (Zmodem)
zmputs(Attn);
canit(); mode(0);
- fprintf(stderr, "rz: caught signal %d; exiting", n);
+ fprintf(Logstream, "rz: caught signal %d; exiting\n", n);
exit(3);
}
@@ -297,6 +297,9 @@
Zrwindow = atoi(*++argv);
}
break;
+ case 'V':
+ log_to_screen = 1;
+ /* fall */
case 'v':
++Verbose; break;
case 'y':
@@ -318,14 +321,14 @@
usage();
if (Batch && npats)
usage();
- if (Verbose) {
- if (freopen(LOGFILE, "a", stderr)==NULL)
- if (freopen(LOGFILE2, "a", stderr)==NULL) {
- fprintf(stderr, "Can't open log file!\n");
+ if (Verbose && !log_to_screen) {
+ if ((Logstream = fopen(LOGFILE, "a"))==NULL)
+ if ((Logstream = fopen(LOGFILE2, "a"))==NULL) {
+ fprintf(stderr, "Can't open log file!\n");
exit(2);
}
- setbuf(stderr, NULL);
- fprintf(stderr, "argv[0]=%s Progname=%s\n", virgin, Progname);
+ setbuf(Logstream, NULL);
+ fprintf(Logstream, "argv[0]=%s Progname=%s\n", virgin, Progname);
}
vfile("%s %s for %s tty=%s\n", Progname, VERSION, OS, Nametty);
mode(1);
@@ -342,8 +345,11 @@
}
if (exitcode && !Zmodem) /* bellow again with all thy might. */
canit();
- if (endmsg[0])
+ if (endmsg[0]) {
fprintf(stderr, " %s: %s\r\n", Progname, endmsg);
+ if (Verbose)
+ fprintf(Logstream, "%s\r\n", endmsg);
+ }
fprintf(stderr, "%s %s finished.\r\n", Progname, VERSION);
fflush(stderr);
if(exitcode) {
@@ -374,10 +380,10 @@
{
fprintf(stderr,
"Receive Files and Commands with ZMODEM/YMODEM/XMODEM Protocol\n\n");
- fprintf(stderr,"Usage: rz [-v] [-wN] [-tT] (ZMODEM)\n");
- fprintf(stderr,"or rb [-avy] [-tT] (YMODEM)\n");
- fprintf(stderr,"or rc [-avy] [-tT] file (XMODEM-CRC)\n");
- fprintf(stderr,"or rx [-avy] [-tT] file (XMODEM)\n\n");
+ fprintf(stderr,"Usage: rz [-vV] [-wN] [-tT] (ZMODEM)\n");
+ fprintf(stderr,"or rb [-avVy] [-tT] (YMODEM)\n");
+ fprintf(stderr,"or rc [-avVy] [-tT] file (XMODEM-CRC)\n");
+ fprintf(stderr,"or rx [-avVy] [-tT] file (XMODEM)\n\n");
fprintf(stderr,
"Supports the following incoming ZMODEM options given to the sending program:\n\
compression (-Z), binary (-b), ASCII CR/LF>NL (-a), newer(-n),\n\
@@ -471,13 +477,13 @@
et_tu:
Firstsec=TRUE; Eofseen=FALSE;
+ purgeline(); /* Do read next time ... */
sendline(Crcflg?WANTCRC:NAK); flushmo();
- Lleft=0; /* Do read next time ... */
switch (c = wcgetsec(rpn, 100)) {
case WCEOT:
zperr2( "Pathname fetch returned %d", c);
+ purgeline(); /* Do read next time ... */
sendline(ACK); flushmo();
- Lleft=0; /* Do read next time ... */
readline(1);
goto et_tu;
case 0:
@@ -502,9 +508,9 @@
sendchar=Crcflg?WANTCRC:NAK;
for (;;) {
+ purgeline(); /* Do read next time ... */
sendline(sendchar); /* send it now, we're ready! */
flushmo();
- Lleft=0; /* Do read next time ... */
sectcurr=wcgetsec(secbuf, (sectnum&0177)?50:130);
if (sectcurr==(sectnum+1 &0377)) {
sectnum++;
@@ -523,8 +529,8 @@
else if (sectcurr==WCEOT) {
if (closeit())
return ERROR;
+ purgeline(); /* Do read next time ... */
sendline(ACK); flushmo();
- Lleft=0; /* Do read next time ... */
++Totfiles;
return OK;
}
@@ -624,11 +630,11 @@
while(readline(1)!=TIMEOUT)
;
if (Firstsec) {
+ purgeline(); /* Do read next time ... */
sendline(Crcflg?WANTCRC:NAK); flushmo();
- Lleft=0; /* Do read next time ... */
} else {
+ purgeline(); /* Do read next time ... */
maxtime=40; sendline(NAK); flushmo();
- Lleft=0; /* Do read next time ... */
}
}
/* try to stop the bubble machine. */
@@ -683,9 +689,9 @@
++Thisbinary;
++Totfiles; Totbytes += Bytesleft;
if (Verbose) {
- fprintf(stderr, "Incoming: %s %ld %lo %o\n",
+ fprintf(Logstream, "Incoming: %s %ld %lo %o\n",
name, Bytesleft, Modtime, Filemode);
- fprintf(stderr, "YMODEM header: %s\n", p);
+ fprintf(Logstream, "YMODEM header: %s\n", p);
}
}
@@ -706,7 +712,7 @@
zmanag &= ZMMASK;
if (zmanag==ZMPROT)
goto skipfile;
- vfile("Current %s is %ld %lo", name, f.st_size, f.st_mtime);
+ vfile("Current %s is %ld %lo", name, (long)f.st_size, f.st_mtime);
if (Thisbinary && zconv==ZCRESUM) {
rxbytes = f.st_size & ~511;
if (Bytesleft < rxbytes) {
@@ -953,7 +959,7 @@
if (Restricted) {
if (fopen(name, "r") != NULL) {
canit();
- fprintf(stderr, "\r\nrz: %s exists\n", name);
+ fprintf(stderr, "\r\nrz: %s exists\r\n", name);
bibi(-1);
}
/* restrict pathnames to current tree or uucppublic */
@@ -1072,6 +1078,10 @@
return ERROR;
}
#endif
+#ifndef BIG_SECURITY_HOLE
+ sprintf(endmsg, "ZCOMMAND Denied.");
+ return ERROR;
+#else
cmdzack1flg = Rxhdr[ZF0];
if (zrdata(secbuf, 1024) == GOTCRCW) {
void exec2();
@@ -1091,6 +1101,7 @@
return ZCOMPL;
}
zshhdr(4,ZNAK, Txhdr); goto again;
+#endif
case ZCOMPL:
goto again;
default:
@@ -1245,7 +1256,7 @@
}
moredata:
if (Verbose>1)
- fprintf(stderr, "%7ld ZMODEM%s\n",
+ fprintf(Logstream, "%7ld ZMODEM%s\n",
rxbytes, Crc32r?" CRC-32":"");
#ifdef SEGMENTS
if (chinseg >= (1024 * SEGMENTS)) {

View File

@ -1,286 +0,0 @@
--- sz.c.orig Tue Nov 30 15:08:18 1999
+++ sz.c Tue Nov 30 15:49:37 1999
@@ -192,6 +192,8 @@
STATIC jmp_buf intrjmp; /* For the interrupt on RX CAN */
+int log_to_screen = 0; /* Don't make log file *
+
/* send cancel string to get the other end to shut up */
canit()
@@ -199,9 +201,8 @@
static char canistr[] = {
24,24,24,24,24,24,24,24,24,24,0
};
-
+ purgeline(); /* Do read next time ... */
zmputs(canistr);
- Lleft=0; /* Do read next time ... */
}
@@ -210,11 +211,11 @@
bibi(n)
{
canit(); fflush(stdout); mode(0);
- fprintf(stderr, "sz: caught signal %d; exiting\n", n);
+ fprintf(Logstream, "sz: caught signal %d; exiting\n", n);
if (n == SIGQUIT)
abort();
if (n == 99)
- fprintf(stderr, "mode(2) in rbsb.c not implemented!!\n");
+ fprintf(Logstream, "mode(2) in rbsb.c not implemented!!\n");
exit(3);
}
@@ -252,9 +253,9 @@
{
if (Verbose <= 0)
return;
- fprintf(stderr, "Retry %d: ", errors);
- fprintf(stderr, s, p);
- fprintf(stderr, "\n");
+ fprintf(Logstream, "Retry %d: ", errors);
+ fprintf(Logstream, s, p);
+ fprintf(Logstream, "\n");
}
void
@@ -360,6 +361,9 @@
mode(0); exit(0);
case 'u':
++Unlinkafter; break;
+ case 'V':
+ log_to_screen = 1;
+ /* fall */
case 'v':
++Verbose; break;
case 'w':
@@ -408,13 +412,13 @@
}
if (npats < 1 && !Command && !Test)
usage();
- if (Verbose) {
- if (freopen(LOGFILE, "a", stderr)==NULL)
- if (freopen(LOGFILE2, "a", stderr)==NULL) {
- printf("Can't open log file!");
+ if (Verbose && !log_to_screen) {
+ if ((Logstream = fopen(LOGFILE, "a"))==NULL)
+ if ((Logstream = fopen(LOGFILE2, "a"))==NULL) {
+ fprintf(stderr, "Can't open log file!\n");
exit(2);
}
- setbuf(stderr, NULL);
+ setbuf(Logstream, NULL);
}
vfile("%s %s for %s tty=%s\n", Progname, VERSION, OS, Nametty);
@@ -464,12 +468,11 @@
"%d file(s) skipped by receiver request\r\n", Skipcount);
}
if (endmsg[0]) {
- printf("\r\n%s: %s\r\n", Progname, endmsg);
+ fprintf(stderr, "\r\n%s: %s\r\n", Progname, endmsg);
if (Verbose)
- fprintf(stderr, "%s\r\n", endmsg);
+ fprintf(Logstream, "%s\r\n", endmsg);
}
- printf("%s %s finished.\r\n", Progname, VERSION);
- fflush(stdout);
+ fprintf(stderr, "%s %s finished.\r\n", Progname, VERSION);
if(errcnt || Exitcode) {
mode(0); exit(1);
}
@@ -484,9 +487,8 @@
canit();
sleep(4);
printf("%s %s finished.\r\n", Progname, VERSION);
- printf("\n\n\n**** UNREGISTERED COPY *****\r\n");
- printf("\n\n\nPlease read the License Agreement in sz.doc\r\n");
- fflush(stdout);
+ fprintf(stderr, "\n\n\n**** UNREGISTERED COPY *****\r\n");
+ fprintf(stderr, "\n\n\nPlease read the License Agreement in sz.doc\n");
}
#endif
fflush(stdout);
@@ -522,8 +524,7 @@
bytcnt = maxbytcnt = -1;
vfile("wcsend: argc=%d", argc);
if (Nozmodem) {
- printf("Start your local YMODEM receive. ");
- fflush(stdout);
+ fprintf(stderr, "Start your local YMODEM receive. ");
}
for (n=0; n<argc; ++n) {
Totsecs = 0;
@@ -617,7 +618,7 @@
default:
return ERROR;
}
- if (!Zmodem && wctx(f.st_size))
+ if (!Zmodem && wctx((long)f.st_size))
return ERROR;
if (Unlinkafter)
@@ -643,11 +644,10 @@
vfile("wctxpn: %s", name);
if (Modem2) {
if (*name && fstat(fileno(in), &f)!= -1) {
- fprintf(stderr, "Sending %s, %ld XMODEM blocks. ",
- name, (127+f.st_size)>>7);
+ fprintf(Logstream, "Sending %s, %ld XMODEM blocks. ",
+ name, (long)((127+f.st_size)>>7));
}
- printf("Start your local XMODEM receive. ");
- fflush(stdout);
+ fprintf(stderr, "Start your local XMODEM receive. ");
return OK;
}
zperr2("Awaiting pathname nak for %s", *name?name:"<END>");
@@ -680,7 +680,7 @@
*q++ = 0;
if (*name) {
if (fstat(fileno(in), &f)!= -1)
- sprintf(p, "%lu %lo %o 3 %d %ld", f.st_size, f.st_mtime,
+ sprintf(p, "%lu %lo %o 3 %d %ld", (long)f.st_size, f.st_mtime,
f.st_mode, Filesleft, Totalleft);
Totalleft -= f.st_size;
}
@@ -805,7 +805,7 @@
firstch=0; /* part of logic to detect CAN CAN */
if (Verbose>1)
- fprintf(stderr, "Sector %3d %2dk\n", Totsecs, Totsecs/8 );
+ fprintf(Logstream, "Sector %3d %2dk\n", Totsecs, Totsecs/8 );
for (attempts=0; attempts <= RETRYMAX; attempts++) {
Lastrx= firstch;
sendline(cseclen==1024?STX:SOH);
@@ -923,7 +923,7 @@
{
long m, n;
- vfile("fooseek: pos =%lu vpos=%lu Canseek=%d", pos, vpos, Canseek);
+ vfile("fooseek: pos =%ld vpos=%ld Canseek=%d", pos, vpos, Canseek);
/* Seek offset < current buffer */
if (pos < (vpos -TXBSIZE +1024)) {
BEofseen = 0;
@@ -1005,11 +1005,13 @@
char *usinfo[] = {
"Send Files and Commands with ZMODEM/YMODEM/XMODEM Protocol\n",
- "Usage: sz [-+abcdefgklLnNuvwxyYZ] [-] file ...",
- "\t zcommand [-egv] COMMAND",
- "\t zcommandi [-egv] COMMAND",
- "\t sb [-adfkuv] [-] file ...",
- "\t sx [-akuv] [-] file",
+ "Usage:",
+ " sz [-+abcdefgknNouvVxyYZ] [-lN] [-LN] [-wN] [-r[r]] [-] file ...",
+ " sz -T",
+ " zcommand [-egvV] COMMAND",
+ " zcommandi [-egvV] COMMAND",
+ " sb [-adfkuvV] [-] file ...",
+ " sx [-akuvV] [-] file",
""
};
@@ -1391,9 +1393,9 @@
}
signal(SIGINT, SIG_IGN); canit();
sleep(20); purgeline(); mode(0);
- printf("\nsz: Tcount = %ld\n", tcount);
+ fprintf(stderr, "\nsz: Tcount = %ld\n", tcount);
if (tleft) {
- printf("ERROR: Interrupts Not Caught\n");
+ fprintf(stderr, "ERROR: Interrupts Not Caught\n");
exit(1);
}
exit(0);
@@ -1414,7 +1416,7 @@
} else
e = ZCRCG;
if (Verbose>1)
- fprintf(stderr, "%7ld ZMODEM%s\n",
+ fprintf(Logstream, "%7ld ZMODEM%s\n",
Txpos, Crc32t?" CRC-32":"");
zsdata(txbuf, n, e);
bytcnt = Txpos += n;
@@ -1506,7 +1508,7 @@
for (;;) {
if (Test) {
- printf("\r\n\n\n***** Signal Caught *****\r\n");
+ fprintf(stderr,"\r\n\n\n***** Signal Caught *****\r\n");
Rxpos = 0; c = ZRPOS;
} else
c = zgethdr(Rxhdr);
@@ -1660,17 +1662,16 @@
for (Totalleft = 0, Filesleft = 0; --argc >=0; ++argv) {
f.st_size = -1;
if (Verbose>2) {
- fprintf(stderr, "\nCountem: %03d %s ", argc, *argv);
- fflush(stderr);
+ fprintf(Logstream, "\nCountem: %03d %s ", argc, *argv);
}
if (access(*argv, 04) >= 0 && stat(*argv, &f) >= 0) {
++Filesleft; Totalleft += f.st_size;
}
if (Verbose>2)
- fprintf(stderr, " %ld", f.st_size);
+ fprintf(Logstream, " %ld", (long)f.st_size);
}
if (Verbose>2)
- fprintf(stderr, "\ncountem: Total %d %ld\n",
+ fprintf(Logstream, "\ncountem: Total %d %ld\n",
Filesleft, Totalleft);
Totfiles = Filesleft; Totbytes = Totalleft;
}
@@ -1680,33 +1681,34 @@
register n;
mode(m);
- printf("\r\n\nCharacter Transparency Test Mode %d\r\n", m);
- printf("If Pro-YAM/ZCOMM is not displaying ^M hit ALT-V NOW.\r\n");
- printf("Hit Enter.\021"); fflush(stdout);
+ fprintf(stderr, "\r\n\nCharacter Transparency Test Mode %d\r\n", m);
+ fprintf(stderr, "If Pro-YAM/ZCOMM is not displaying ^M hit ALT-V NOW.\r\n");
+ purgeline();
+ fprintf(stderr, "Hit Enter.");
readline(500);
for (n = 0; n < 256; ++n) {
if (!(n%8))
- printf("\r\n");
- printf("%02x ", n); fflush(stdout);
+ fprintf(stderr, "\r\n");
+ fprintf(stderr, "%02x ", n);
sendline(n); flushmo();
- printf(" "); fflush(stdout);
+ fprintf(stderr, " ");
if (n == 127) {
- printf("Hit Enter.\021"); fflush(stdout);
+ purgeline();
+ fprintf(stderr, "Hit Enter.");
readline(500);
- printf("\r\n"); fflush(stdout);
+ fprintf(stderr, "\r\n");
}
}
- printf("\021\r\nEnter Characters, echo is in hex.\r\n");
- printf("Hit SPACE or pause 40 seconds for exit.\r\n");
+ purgeline();
+ fprintf(stderr, "\r\nEnter Characters, echo is in hex.\r\n");
+ fprintf(stderr, "Hit SPACE or pause 40 seconds for exit.\r\n");
while (n != TIMEOUT && n != ' ') {
n = readline(400);
- printf("%02x\r\n", n);
- fflush(stdout);
+ fprintf(stderr, "%02x\r\n", n);
}
- printf("\r\nMode %d character transparency test ends.\r\n", m);
- fflush(stdout);
+ fprintf(stderr, "\r\nMode %d character transparency test ends.\r\n", m);
}
/*

View File

@ -1 +0,0 @@
receive/send files via X/Y/ZMODEM protocol

View File

@ -1,4 +0,0 @@
This program uses error correcting protocols to send/receive
files over a dial-in serial port from a variety of programs
running under PC-DOS, CP/M, Unix, and other operating
systems.

View File

@ -1,20 +0,0 @@
bin/rz
bin/rx
bin/rb
bin/rc
bin/sz
bin/sx
bin/sb
bin/zcommand
bin/zcommandi
bin/crc
man/cat1/crc.1
man/cat1/rz.1
man/cat1/rx.1
man/cat1/rb.1
man/cat1/rc.1
man/cat1/sz.1
man/cat1/sx.1
man/cat1/sb.1
man/cat1/zcommand.1
man/cat1/zcommandi.1

View File

@ -1,6 +0,0 @@
#!/bin/sh
#
# shuffle things around for bmake to work right
#
mv ${WRKDIR}/makefile ${WRKDIR}/makefile.dist
cp ${FILESDIR}/makefile ${WRKDIR}/Makefile