Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!udel!mmdf From: Peter_Van_Epp@cc.sfu.ca Newsgroups: comp.os.minix Subject: Some changes to uud for use under DOS Message-ID: <6914@nigel.udel.EDU> Date: 27 Dec 89 03:34:55 GMT Sender: mmdf@udel.EDU Lines: 193 I have finally (with lots of help from Glen@ndsuvm1 thanks for the crcs Glen!) figured out how to get the 1.5 files decoded. I had 2 problems: uud wouldn't work under Minix, and it worked but the files wouldn't decompress under DOS. There turned out to be two problems, both easy to fix (but less easy to find!). The reason uud wouldn't work under Minix is that sscanf in libc.a binary that was on bugs.nosc.mil appears (at least my copy!) to have a bad scanf.s which was returning garbage for the number of results and killing uud under Minix, the fix is to reassemble and replace scanf.s in the library. The second problem is that the output of uud under DOS wasn't matching the crcs in the intro posting, after much head scratching I finally figured out that the output file wasn't being opened for binary write and was therefore adding the lf to the correct cr and screwing up compress. Again simple to fix and I have attached a cdif that patches this (and makes the selection of system type clearer at least to me!) to the end of this message. Now I can proceed with getting 1.5 up and moved across to both my Xt-clone and a PS/2 model 55 SX (a microchannel 386 sx machine) at least I hope! Thanks to Andy for the posting of 1.5, and to Glen for both the help and the archive at NDSUVM1. ---------------------- cut here ------------------------- *** uud.ast Tue Dec 26 21:19:36 1989 --- uud.c Tue Dec 26 21:04:38 1989 *************** *** 8,31 **** * The MSDOS version with TurboC. * The Unix version with cc. * this version is made: 25 Nov 1988. */ /* * Be sure to have the proper symbol at this point. (GEMDOS, MSDOS, UNIX...) ! */ ! /* ! #ifndef GEMDOS ! #define GEMDOS 1 ! #endif ! */ ! #ifndef UNIX ! #define UNIX 1 ! #endif ! /* ! #ifndef MSDOS ! #define MSDOS 1 ! #endif ! */ #ifdef GEMDOS #define SYSNAME "gemdos" --- 8,25 ---- * The MSDOS version with TurboC. * The Unix version with cc. * this version is made: 25 Nov 1988. + * 26 Dec 1989: change the operating system select, and make MSDOS also do + * the file output "wb". Peter Van Epp */ /* * Be sure to have the proper symbol at this point. (GEMDOS, MSDOS, UNIX...) ! * (the default setting (UNIX) is the one to use for MINIX) ! */ ! /* ! ! #define UNIX 1 /* one of (GEMDOS, MSDOS, or UNIX) */ ! #ifdef GEMDOS #define SYSNAME "gemdos" *************** *** 44,53 **** #ifdef GEMDOS #include #define Error(n) ; Bconin(2); exit(n); : ! #define WRITE "wb" ! #else ! #define Error(n) exit(n) ! #define WRITE "w" #endif #define loop while (1) --- 38,51 ---- #ifdef GEMDOS #include #define Error(n) ; Bconin(2); exit(n); : ! #else ! #define Error(n) exit(n) ! #endif ! ! #ifdef UNIX ! #define WRITE "w" ! #else ! #define WRITE "wb" /* for both GEMDOS and MSDOS! */ #endif #define loop while (1) *************** *** 58,64 **** char *getnword(); ! #define NCHARS 256 #define LINELEN 256 #define FILELEN 64 #define NORMLEN 60 /* allows for 80 encoded chars per line */ --- 56,62 ---- char *getnword(); ! #define MAXCHAR 256 #define LINELEN 256 #define FILELEN 64 #define NORMLEN 60 /* allows for 80 encoded chars per line */ *************** *** 75,81 **** char blank, part = '[0'; int partn, lens; int debug = 0, nochk = 0, onedone = 0; ! int chtbl]NCHARS(, cdlen]NORMLEN + 3(; main(argc, argv) int argc; char *argv](; ; --- 73,79 ---- char blank, part = '[0'; int partn, lens; int debug = 0, nochk = 0, onedone = 0; ! int chtbl]MAXCHAR(, cdlen]NORMLEN + 3(; main(argc, argv) int argc; char *argv](; ; *************** *** 155,161 **** */ for (i = 0; i < ' '; i++) chtbl]i( = -1; for (i = ' ', j = 0; i < ' ' + 64; i++, j++) chtbl]i( = j; ! for (i = ' ' + 64; i < NCHARS; i++) chtbl]i( = -1; chtbl]'*'( = chtbl]' '(; /* common mutation */ chtbl]','( = chtbl]','(; /* an other common mutation */ blank = ' '; --- 153,159 ---- */ for (i = 0; i < ' '; i++) chtbl]i( = -1; for (i = ' ', j = 0; i < ' ' + 64; i++, j++) chtbl]i( = j; ! for (i = ' ' + 64; i < MAXCHAR; i++) chtbl]i( = -1; chtbl]'*'( = chtbl]' '(; /* common mutation */ chtbl]','( = chtbl]','(; /* an other common mutation */ blank = ' '; *************** *** 199,205 **** if(sscanf(buf,"begin%o%s", &mode, dest) != 2) #endif ; ! format("uud: Missing filename in begin line.[n"); Error(10); : --- 197,203 ---- if(sscanf(buf,"begin%o%s", &mode, dest) != 2) #endif ; ! format("uud: Missing filename in begin line.[n"); Error(10); : *************** *** 253,259 **** register int c, n = 0; register char *cpt; ! for (c = 0; c < NCHARS; c++) chtbl]c( = -1; again: if (fgets(buf, sizeof buf, in) == NULL) ; format("uud: EOF while in translation table.[n"); --- 251,257 ---- register int c, n = 0; register char *cpt; ! for (c = 0; c <= MAXCHAR; c++) chtbl]c( = -1; again: if (fgets(buf, sizeof buf, in) == NULL) ; format("uud: EOF while in translation table.[n"); *************** *** 561,563 **** --- 559,570 ---- putchar(c); #endif : + /* + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ + | MINIX User Group (Holland) UUCP: hp4nl!kyber!minixug!waltje | + | c/o Fred van Kempen, or: minixug!waltje@kyber.UUCP | + | Hoefbladhof 27 | + | 2215 DV VOORHOUT | + | The Netherlands "A good programmer knows his Sources" | + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ + */