[comp.os.minix] Some changes to uud for use under DOS

Peter_Van_Epp@cc.sfu.ca (12/27/89)

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 <osbind.h>
  #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 <osbind.h>
  #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"   |
+ +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
+ */

Peter_Van_Epp@cc.sfu.ca (12/28/89)

I just discovered that uud ing on DOS doesn't work, the share filenames  are
too long and it happily truncates the names and then writes them over each 
other so you loose a bunch of the files. Copying them over to minix  and then
using  dosread with the -a option to strip LFs and then uud ing them and   
decompressing them has worked for the first 31 (so far!) for me. It also 
appears that file 10 and file 16 have the same .Z file name so you need to
either rename them or move one to another directory. If you need to do the
uuds under DOS it should be possible to do it by uuding and then uncompressing
and renaming the files as required (ie. do the uud and uncompress one after the 
other rather than do all the  uuds then uncompress everything.