Path: utzoo!utgpu!watmath!uunet!ethos!pcid!gizzmo!fthood!egray From: egray@fthood.UUCP Newsgroups: unix-pc.sources Subject: Patch #3 to Xmodem v3.6 Message-ID: <6800106@fthood> Date: 31 Jan 89 20:57:00 GMT Lines: 67 Nf-ID: #N:fthood:6800106:000:1777 Nf-From: fthood.UUCP!egray Jan 31 14:57:00 1989 This is an *unoffical* patch to Steve Grandi's Xmodem v3.6. Well, it seems that when I make a mistake, I make it in several places! This patch will fix the "truncate error" bug that not only appeared in Xmodem, but in Pcomm as well. Emmet P. Gray US Army, HQ III Corps & Fort Hood ...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV Directorate of Engineering & Housing Environmental Management Office Fort Hood, TX 76544-5057 ------------------------------------------------------------------------------ *** old/receive.c Wed Sep 14 12:32:08 1988 --- receive.c Tue Jan 31 14:17:33 1989 *************** *** 555,559 FILE *fp, *tempfp; register int num; ! char *tempfile, *mktemp(), buf[BUFSIZ]; if (!(fp = fopen(file, "r"))) --- 555,560 ----- FILE *fp, *tempfp; register int num; ! char *s, tempfile[128], *strrchr(), *strcpy(), *strcat(), *mktemp(); ! char buf[BUFSIZ]; if (!(fp = fopen(file, "r"))) *************** *** 566,570 * links across different file systems aren't allowed). */ ! tempfile = mktemp("trunXXXXXX"); if (!(tempfp = fopen(tempfile, "w"))) { fclose(fp); --- 567,578 ----- * links across different file systems aren't allowed). */ ! strcpy(tempfile, file); ! if (s = strrchr(tempfile, '/')) ! *++s = '\0'; ! else ! strcpy(tempfile, "./"); ! strcat(tempfile, "trunXXXXXX"); ! mktemp(tempfile); ! if (!(tempfp = fopen(tempfile, "w"))) { fclose(fp); *** old/xmodem.h Sat Jul 16 22:38:18 1988 --- xmodem.h Tue Jan 31 14:44:12 1989 *************** *** 12,15 #include #include #endif /* SYSV */ #include --- 12,16 ----- #include #include + #define strrchr rindex #endif /* SYSV */ #include