home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip512.zip / os2 / wat_met.dif < prev    next >
Internet Message Format  |  1994-08-05  |  20KB

  1. Date:     Wed, 3 Aug 1994 19:34:23 +0200
  2. From: Kai Uwe Rommel <rommel@ars.muc.de>
  3.  
  4. Enclosed I send the revised set of patches. That does now also include
  5. some changes required for MetaWare High C++ for OS/2.
  6.  
  7.  
  8. diff -cbr unzip/envargs.c unzip-2/envargs.c
  9. *** unzip/envargs.c    Thu Apr 21 10:02:16 1994
  10. --- unzip-2/envargs.c    Tue Aug 02 11:48:46 1994
  11. ***************
  12. *** 180,186 ****
  13. --- 180,188 ----
  14.       char ***argvp;
  15.   {
  16.   #ifndef MSC /* declared differently in MSC 7.0 headers, at least */
  17. + #ifndef __WATCOMC__
  18.       extern char **environ;          /* environment */
  19. + #endif
  20.   #endif
  21.       char        **envp;             /* pointer into environment */
  22.       char        **newargv;          /* new argument list */
  23. diff -cbr unzip/extract.c unzip-2/extract.c
  24. *** unzip/extract.c    Fri Jul 22 13:03:48 1994
  25. --- unzip-2/extract.c    Tue Aug 02 11:48:46 1994
  26. ***************
  27. *** 863,869 ****
  28. --- 863,873 ----
  29.           if (cflag) {
  30.               outfile = stdout;
  31.   #ifdef DOS_NT_OS2
  32. + #ifdef __HIGHC__
  33. +             setmode(outfile, _BINARY);
  34. + #else
  35.               setmode(fileno(outfile), O_BINARY);
  36. + #endif
  37.   #           define NEWLINE "\r\n"
  38.   #else
  39.   #           define NEWLINE "\n"
  40. diff -cbr unzip/funzip.c unzip-2/funzip.c
  41. *** unzip/funzip.c    Sun Jul 31 20:28:52 1994
  42. --- unzip-2/funzip.c    Tue Aug 02 11:48:48 1994
  43. ***************
  44. *** 238,250 ****
  45. --- 238,258 ----
  46.     else
  47.     {
  48.   #ifdef DOS_NT_OS2
  49. + #ifdef __HIGHC__
  50. +     setmode(stdin, _BINARY);
  51. + #else
  52.       setmode(0, O_BINARY);  /* some buggy C libraries require BOTH setmode() */
  53. + #endif
  54.   #endif                     /*  call AND the fdopen() in binary mode :-( */
  55.       if ((in = fdopen(0, FOPR)) == (FILE *)NULL)
  56.         err(2, "cannot find stdin");
  57.     }
  58.   #ifdef DOS_NT_OS2
  59. + #ifdef __HIGHC__
  60. +   setmode(stdout, _BINARY);
  61. + #else
  62.     setmode(1, O_BINARY);
  63. + #endif
  64.   #endif
  65.     if ((out = fdopen(1, FOPW)) == (FILE *)NULL)
  66.       err(2, "cannot write to stdout");
  67. diff -cbr unzip/msdos/msdos.c unzip-2/msdos/msdos.c
  68. *** unzip/msdos/msdos.c    Wed Jul 27 22:20:06 1994
  69. --- unzip-2/msdos/msdos.c    Tue Aug 02 11:48:52 1994
  70. ***************
  71. *** 37,45 ****
  72.   static int renamed_fullpath;   /* ditto */
  73.   static unsigned nLabelDrive;   /* ditto, plus volumelabel() */
  74.   
  75. ! #if (defined(__GO32__) || defined(__EMX__))
  76. ! #  define MKDIR(path,mode)   mkdir(path,mode)
  77.   #  include <dirent.h>        /* use readdir() */
  78.   #  define direct dirent
  79.   #  define Opendir opendir
  80.   #  define Readdir readdir
  81. --- 37,57 ----
  82.   static int renamed_fullpath;   /* ditto */
  83.   static unsigned nLabelDrive;   /* ditto, plus volumelabel() */
  84.   
  85. ! #if (defined(__WATCOMC__) && defined(__386__))
  86. ! #  define WREGS(v,r) (v##.w.##r)
  87. ! #  define int86x int386x
  88. ! #else
  89. ! #  define WREGS(v,r) (v##.x.##r)
  90. ! #endif
  91. ! #if (defined(__GO32__) || defined(__EMX__) || defined(__WATCOMC__))
  92. ! #  ifdef __WATCOMC__
  93. ! #    include <direct.h>
  94. ! #    define MKDIR(path,mode)   mkdir(path)
  95. ! #  else
  96.   #  include <dirent.h>        /* use readdir() */
  97. + #    define MKDIR(path,mode)   mkdir(path,mode)
  98. + #  endif
  99.   #  define direct dirent
  100.   #  define Opendir opendir
  101.   #  define Readdir readdir
  102. ***************
  103. *** 774,791 ****
  104.       regs.h.bl = (uch)nDrive;
  105.   #ifdef __EMX__
  106.       _int86(0x21, ®s, ®s);
  107. !     if (regs.x.flags & 1)
  108.   #else
  109.       intdos(®s, ®s);
  110. !     if (regs.x.cflag)        /* error:  do default a/b check instead */
  111.   #endif
  112.       {
  113.           Trace((stderr,
  114.             "error in DOS function 0x44 (AX = 0x%04x):  guessing instead...\n",
  115. !           regs.x.ax));
  116.           return (nDrive == 1 || nDrive == 2)? TRUE : FALSE;
  117.       } else
  118. !         return regs.x.ax? FALSE : TRUE;
  119.   }
  120.   
  121.   
  122. --- 786,803 ----
  123.       regs.h.bl = (uch)nDrive;
  124.   #ifdef __EMX__
  125.       _int86(0x21, ®s, ®s);
  126. !     if (WREGS(regs,flags) & 1)
  127.   #else
  128.       intdos(®s, ®s);
  129. !     if (WREGS(regs,cflag))        /* error:  do default a/b check instead */
  130.   #endif
  131.       {
  132.           Trace((stderr,
  133.             "error in DOS function 0x44 (AX = 0x%04x):  guessing instead...\n",
  134. !           WREGS(regs,ax)));
  135.           return (nDrive == 1 || nDrive == 2)? TRUE : FALSE;
  136.       } else
  137. !         return WREGS(regs,ax)? FALSE : TRUE;
  138.   }
  139.   
  140.   
  141. ***************
  142. *** 854,874 ****
  143.   
  144.       /* set the disk transfer address for subsequent FCB calls */
  145.       sregs.ds = FP_SEG(pdta);
  146. !     regs.x.dx = FP_OFF(pdta);
  147. !     Trace((stderr, "segment:offset of pdta = %x:%x\n", sregs.ds, regs.x.dx));
  148.       Trace((stderr, "&dta = %lx, pdta = %lx\n", (ulg)&dta, (ulg)pdta));
  149.       regs.h.ah = 0x1a;
  150.       intdosx(®s, ®s, &sregs);
  151.   
  152.       /* fill in the FCB */
  153.       sregs.ds = FP_SEG(pfcb);
  154. !     regs.x.dx = FP_OFF(pfcb);
  155.       pfcb->flag = 0xff;          /* extended FCB */
  156.       pfcb->vattr = 0x08;         /* attribute:  disk volume label */
  157.       pfcb->drive = (uch)nLabelDrive;
  158.   
  159.   #ifdef DEBUG
  160. !     Trace((stderr, "segment:offset of pfcb = %x:%x\n", sregs.ds, regs.x.dx));
  161.       Trace((stderr, "&fcb = %lx, pfcb = %lx\n", (ulg)&fcb, (ulg)pfcb));
  162.       Trace((stderr, "(2nd check:  labelling drive %c:)\n", pfcb->drive-1+'A'));
  163.       if (pfcb->flag != fcb.flag)
  164. --- 866,886 ----
  165.   
  166.       /* set the disk transfer address for subsequent FCB calls */
  167.       sregs.ds = FP_SEG(pdta);
  168. !     WREGS(regs,dx) = FP_OFF(pdta);
  169. !     Trace((stderr, "segment:offset of pdta = %x:%x\n", sregs.ds, WREGS(regs,dx)));
  170.       Trace((stderr, "&dta = %lx, pdta = %lx\n", (ulg)&dta, (ulg)pdta));
  171.       regs.h.ah = 0x1a;
  172.       intdosx(®s, ®s, &sregs);
  173.   
  174.       /* fill in the FCB */
  175.       sregs.ds = FP_SEG(pfcb);
  176. !     WREGS(regs,dx) = FP_OFF(pfcb);
  177.       pfcb->flag = 0xff;          /* extended FCB */
  178.       pfcb->vattr = 0x08;         /* attribute:  disk volume label */
  179.       pfcb->drive = (uch)nLabelDrive;
  180.   
  181.   #ifdef DEBUG
  182. !     Trace((stderr, "segment:offset of pfcb = %x:%x\n", sregs.ds, WREGS(regs,dx)));
  183.       Trace((stderr, "&fcb = %lx, pfcb = %lx\n", (ulg)&fcb, (ulg)pfcb));
  184.       Trace((stderr, "(2nd check:  labelling drive %c:)\n", pfcb->drive-1+'A'));
  185.       if (pfcb->flag != fcb.flag)
  186. ***************
  187. *** 894,900 ****
  188.       strncpy((char *)fcb.vn, "???????????", 11);   /* i.e., "*.*" */
  189.       Trace((stderr, "fcb.vn = %lx\n", (ulg)fcb.vn));
  190.       Trace((stderr, "regs.h.ah = %x, regs.x.dx = %04x, sregs.ds = %04x\n",
  191. !       regs.h.ah, regs.x.dx, sregs.ds));
  192.       Trace((stderr, "flag = %x, drive = %d, vattr = %x, vn = %s = %s.\n",
  193.         fcb.flag, fcb.drive, fcb.vattr, fcb.vn, pfcb->vn));
  194.       intdosx(®s, ®s, &sregs);
  195. --- 906,912 ----
  196.       strncpy((char *)fcb.vn, "???????????", 11);   /* i.e., "*.*" */
  197.       Trace((stderr, "fcb.vn = %lx\n", (ulg)fcb.vn));
  198.       Trace((stderr, "regs.h.ah = %x, regs.x.dx = %04x, sregs.ds = %04x\n",
  199. !       regs.h.ah, WREGS(regs,dx), sregs.ds));
  200.       Trace((stderr, "flag = %x, drive = %d, vattr = %x, vn = %s = %s.\n",
  201.         fcb.flag, fcb.drive, fcb.vattr, fcb.vn, pfcb->vn));
  202.       intdosx(®s, ®s, &sregs);
  203. ***************
  204. *** 1058,1065 ****
  205.       union REGS regs;
  206.   
  207.       sregs.ds  = FP_SEG(CountryInfo);
  208. !     regs.x.dx = FP_OFF(CountryInfo);
  209. !     regs.x.ax = 0x3800;
  210.       int86x(0x21, ®s, ®s, &sregs);
  211.   
  212.   #else /* __GO32__ || __EMX__ */
  213. --- 1070,1077 ----
  214.       union REGS regs;
  215.   
  216.       sregs.ds  = FP_SEG(CountryInfo);
  217. !     WREGS(regs,dx) = FP_OFF(CountryInfo);
  218. !     WREGS(regs,ax) = 0x3800;
  219.       int86x(0x21, ®s, ®s, &sregs);
  220.   
  221.   #else /* __GO32__ || __EMX__ */
  222. diff -cbr unzip/os2/makefile.os2 unzip-2/os2/makefile.os2
  223. *** unzip/os2/makefile.os2    Sat Jul 23 13:42:04 1994
  224. --- unzip-2/os2/makefile.os2    Tue Aug 02 11:53:42 1994
  225. ***************
  226. *** 32,43 ****
  227.   #   For Watcom C/386, edit the os2$(OBJ) target so that os2/os2.c reads
  228.   #   os2\os2.c instead.  Watcom can't handle forward slashes; gcc can't
  229.   #   handle backslashes.  We'll see about making this a macro next time...
  230.   
  231.   default:
  232.       @echo "Enter `$(MAKE) -f makefile.os2 target' with makefile.os2 copied"
  233.       @echo "to the main UnZip directory and where target is one of:"
  234.       @echo "   msc mscdos ibm ibmdyn ibmdebug ibmprof"
  235. !     @echo "   watcom borland gcc gccdyn gccdebug gccdos"
  236.   
  237.   # MS C 6.00 for OS/2, 16-bit (should figure out way to split unzip/funzip 
  238.   # compiles so former is always large model and latter always small model...)
  239. --- 32,45 ----
  240.   #   For Watcom C/386, edit the os2$(OBJ) target so that os2/os2.c reads
  241.   #   os2\os2.c instead.  Watcom can't handle forward slashes; gcc can't
  242.   #   handle backslashes.  We'll see about making this a macro next time...
  243. + #   Same for msdos/msdos.c ...
  244.   
  245.   default:
  246.       @echo "Enter `$(MAKE) -f makefile.os2 target' with makefile.os2 copied"
  247.       @echo "to the main UnZip directory and where target is one of:"
  248.       @echo "   msc mscdos ibm ibmdyn ibmdebug ibmprof"
  249. !     @echo "   metaware borland gcc gccdyn gccdebug gccdos"
  250. !     @echo "   watcom watcom16 watcomdos watcom16dos"
  251.   
  252.   # MS C 6.00 for OS/2, 16-bit (should figure out way to split unzip/funzip 
  253.   # compiles so former is always large model and latter always small model...)
  254. ***************
  255. *** 52,57 ****
  256. --- 54,71 ----
  257.       OBJ=".obj" \
  258.       DEF="os2\unzip16.def"
  259.   
  260. + # MS C 6.00 for OS/2, debug version
  261. + mscdebug:
  262. +     $(MAKE) -f makefile.os2 all \
  263. +     CC="cl -nologo -AL -Zi -Od -I. $(FP)" \
  264. +     CFLAGS="-G2 -Zp1 -W3 -DOS2 -DMSC" \
  265. +     NFLAGS="" \
  266. +     LDFLAGS="-Lp -Fe" \
  267. +     LDFLAGS2="-link /noe" \
  268. +     OUT="-Fo" \
  269. +     OBJ=".obj" \
  270. +     DEF="os2\unzip16.def"
  271.   # cross-compilation for MS-DOS with MS C 6.00 (same comment as above...formerly;
  272.   # now unzip is small model again, with [almost] all strings in far memory)
  273.   mscdos:
  274. ***************
  275. *** 59,65 ****
  276.       CC="cl -nologo -AS -Oaict -Gs -I. $(FP)" \
  277.       CFLAGS="-Zp1 -W3 $(LOCAL_UNZIP)" \
  278.       NFLAGS="" \
  279. !     LDFLAGS="-F 0c00 -Lr -Fe" \
  280.       LDFLAGS2="-link /noe /exe" \
  281.       OUT="-Fo" \
  282.       OBJ=".obj" \
  283. --- 73,79 ----
  284.       CC="cl -nologo -AS -Oaict -Gs -I. $(FP)" \
  285.       CFLAGS="-Zp1 -W3 $(LOCAL_UNZIP)" \
  286.       NFLAGS="" \
  287. !     LDFLAGS="-F 0C00 -Lr -Fe" \
  288.       LDFLAGS2="-link /noe /exe" \
  289.       OUT="-Fo" \
  290.       OBJ=".obj" \
  291. ***************
  292. *** 114,131 ****
  293.       OBJ=".obj" \
  294.       DEF="os2\unzip.def"
  295.   
  296. ! # Watcom C/386 9.0
  297.   watcom:
  298.       $(MAKE) -f makefile.os2 all \
  299.       CC="wcl386 -zq -Ox -s -I." \
  300.       CFLAGS="-Zp1 -DOS2 $(LOCAL_UNZIP)" \
  301.       NFLAGS="" \
  302. !     LDFLAGS="-k0x40000 -x -Fe=" \
  303.       LDFLAGS2="" \
  304.       OUT="-Fo" \
  305.       OBJ=".obj" \
  306.       DEF=""
  307.   
  308.   # Borland C++
  309.   borland:
  310.       $(MAKE) -f makefile.os2 all \
  311. --- 128,194 ----
  312.       OBJ=".obj" \
  313.       DEF="os2\unzip.def"
  314.   
  315. ! # Watcom C/386 9.0 or higher
  316.   watcom:
  317.       $(MAKE) -f makefile.os2 all \
  318.       CC="wcl386 -zq -Ox -s -I." \
  319.       CFLAGS="-Zp1 -DOS2 $(LOCAL_UNZIP)" \
  320.       NFLAGS="" \
  321. !     LDFLAGS="-k0x40000 -x -l=os2v2 -Fe=" \
  322.       LDFLAGS2="" \
  323.       OUT="-Fo" \
  324.       OBJ=".obj" \
  325.       DEF=""
  326.   
  327. + # Watcom C/286 9.0 or higher
  328. + watcom16:
  329. +     $(MAKE) -f makefile.os2 all \
  330. +     CC="wcl -zq -ml -Ox -s -I." \
  331. +     CFLAGS="-Zp1 -DOS2" \
  332. +     NFLAGS="" \
  333. +     LDFLAGS="-k0x2000 -x -l=os2 -Fe=" \
  334. +     LDFLAGS2="" \
  335. +     OUT="-Fo" \
  336. +     OBJ=".obj"
  337. + # Watcom C/386 9.0 or higher, crosscompilation for DOS
  338. + watcomdos:
  339. +     $(MAKE) -f makefile.os2 all \
  340. +     CC="wcl386 -zq -Ox -s -I." \
  341. +     CFLAGS="-Zp1 -DMSDOS" \
  342. +     NFLAGS="" \
  343. +     LDFLAGS="-k0x40000 -x -l=dos4g -Fe=" \
  344. +     LDFLAGS2="" \
  345. +     OUT="-Fo" \
  346. +     OBJ=".obj" \
  347. +     OBJU2="msdos.obj" \
  348. +     OBJX2="msdos_.obj"
  349. + # Watcom C/286 9.0 or higher, crosscompilation for DOS
  350. + watcom16dos:
  351. +     $(MAKE) -f makefile.os2 all \
  352. +     CC="wcl -zq -mm -Ox -s -I." \
  353. +     CFLAGS="-Zp1 -DMSDOS" \
  354. +     NFLAGS="" \
  355. +     LDFLAGS="-k0xC00 -x -l=dos -Fe=" \
  356. +     LDFLAGS2="" \
  357. +     OUT="-Fo" \
  358. +     OBJ=".obj" \
  359. +     OBJU2="msdos.obj" \
  360. +     OBJX2="msdos_.obj"
  361. + # MetaWare High C/C++ 3.2
  362. + metaware:
  363. +     $(MAKE) -f makefile.os2 all \
  364. +     CC="hc -O2 -I." \
  365. +     CFLAGS="-D__32BIT__ -DOS2" \
  366. +     NFLAGS="" \
  367. +     LDFLAGS="-o " \
  368. +     LDFLAGS2="" \
  369. +     OUT="-o ./" \
  370. +     OBJ=".obj" \
  371. +     DEF="-Hdef=os2\unzip.def"
  372.   # Borland C++
  373.   borland:
  374.       $(MAKE) -f makefile.os2 all \
  375. ***************
  376. *** 192,198 ****
  377.       extract$(OBJ) file_io$(OBJ) inflate$(OBJ) match$(OBJ) \
  378.       unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ)
  379.   OBJU2 = os2$(OBJ)
  380. ! OBJX  = unzip_$(OBJ) crypt$(OBJ) extract_$(OBJ) file_io$(OBJ) \
  381.       inflate$(OBJ) match$(OBJ)
  382.   OBJX2 = os2_$(OBJ)
  383.   OBJF  = funzip$(OBJ) crypt_$(OBJ) inflate_$(OBJ)
  384. --- 255,261 ----
  385.       extract$(OBJ) file_io$(OBJ) inflate$(OBJ) match$(OBJ) \
  386.       unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ)
  387.   OBJU2 = os2$(OBJ)
  388. ! OBJX  = unzipsfx$(OBJ) crypt$(OBJ) extract_$(OBJ) file_io$(OBJ) \
  389.       inflate$(OBJ) match$(OBJ)
  390.   OBJX2 = os2_$(OBJ)
  391.   OBJF  = funzip$(OBJ) crypt_$(OBJ) inflate_$(OBJ)
  392. ***************
  393. *** 252,256 ****
  394.   inflate_$(OBJ):    inflate.c inflate.h unzip.h crypt.h    # funzip only
  395.       $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ inflate.c
  396.   
  397. ! unzip_$(OBJ):    unzip.c unzip.h crypt.h version.h    # unzipsfx only
  398.       $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ unzip.c
  399. --- 315,319 ----
  400.   inflate_$(OBJ):    inflate.c inflate.h unzip.h crypt.h    # funzip only
  401.       $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ inflate.c
  402.   
  403. ! unzipsfx$(OBJ):    unzip.c unzip.h crypt.h version.h    # unzipsfx only
  404.       $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ unzip.c
  405. diff -cbr unzip/os2/os2.c unzip-2/os2/os2.c
  406. *** unzip/os2/os2.c    Wed Jul 27 22:23:02 1994
  407. --- unzip-2/os2/os2.c    Tue Aug 02 11:48:54 1994
  408. ***************
  409. *** 73,78 ****
  410. --- 73,79 ----
  411.   #define INCL_DOSDEVICES
  412.   #define INCL_DOSDEVIOCTL
  413.   #define INCL_DOSERRORS
  414. + #define INCL_DOSMISC
  415.   #include <os2.h>
  416.   
  417.   #ifdef __32BIT__
  418. ***************
  419. *** 229,238 ****
  420.   #endif
  421.   
  422.   
  423. - #ifdef __WATCOMC__
  424. -    unsigned char __near _osmode = OS2_MODE;
  425. - #endif
  426.   #ifndef SFX
  427.      static char *getdirent(char *);
  428.      static void free_dircontents(struct _dircontents *);
  429. --- 230,235 ----
  430. ***************
  431. *** 387,394 ****
  432.     if ( (pFEA2list = (PFEA2LIST) malloc((size_t) pEAblock -> lSize)) == NULL )
  433.       return;
  434.   
  435. !   if ( memextract((char *) pFEA2list, pEAblock -> lSize,
  436. !                   (char *) (pEAblock + 1), 
  437.                     pEAblock -> nSize - sizeof(pEAblock -> lSize)) )
  438.     {
  439.       free(pFEA2list);
  440. --- 384,391 ----
  441.     if ( (pFEA2list = (PFEA2LIST) malloc((size_t) pEAblock -> lSize)) == NULL )
  442.       return;
  443.   
  444. !   if ( memextract((uch *) pFEA2list, pEAblock -> lSize,
  445. !                   (uch *) (pEAblock + 1), 
  446.                     pEAblock -> nSize - sizeof(pEAblock -> lSize)) )
  447.     {
  448.       free(pFEA2list);
  449. ***************
  450. *** 450,474 ****
  451.   char *GetLoadPath(void) 
  452.   {
  453.   #ifdef __32BIT__ /* generic for 32-bit API */
  454.     PTIB pptib;
  455.     PPIB pppib;
  456.     char *szPath;
  457.   
  458.     DosGetInfoBlocks(&pptib, &pppib);
  459.     szPath = pppib -> pib_pchenv;
  460.   
  461.     while (*szPath) /* find end of process environment */
  462.       szPath = strchr(szPath, 0) + 1;
  463.   
  464.     return szPath + 1; /* .exe file name follows environment */
  465.   
  466. - #else /* 16-bit, specific for MS C 6.00, note: requires large data model */
  467. -   extern char _far *_pgmptr;
  468. -   return _pgmptr;
  469. - #endif
  470.   } /* end function GetLoadPath() */
  471.   
  472.   
  473. --- 447,472 ----
  474.   char *GetLoadPath(void) 
  475.   {
  476.   #ifdef __32BIT__ /* generic for 32-bit API */
  477.     PTIB pptib;
  478.     PPIB pppib;
  479.     char *szPath;
  480.   
  481.     DosGetInfoBlocks(&pptib, &pppib);
  482.     szPath = pppib -> pib_pchenv;
  483. + #else /* 16-bit, note: requires large data model */
  484. +   SEL selEnv;
  485. +   USHORT offCmd;
  486. +   char *szPath;
  487. +   DosGetEnv(&selEnv, &offCmd);
  488. +   szPath = MAKEP(selEnv, 0);
  489. + #endif
  490.   
  491.     while (*szPath) /* find end of process environment */
  492.       szPath = strchr(szPath, 0) + 1;
  493.   
  494.     return szPath + 1; /* .exe file name follows environment */
  495.   
  496.   } /* end function GetLoadPath() */
  497.   
  498.   
  499. ***************
  500. *** 680,686 ****
  501.   {
  502.     static USHORT nLastDrive=(USHORT)(-1), nResult;
  503.     ULONG lMap;
  504. !   BYTE bData[64], bName[3];
  505.   #ifdef __32BIT__
  506.     ULONG nDrive, cbData;
  507.     PFSQBUFFER2 pData = (PFSQBUFFER2) bData;
  508. --- 678,685 ----
  509.   {
  510.     static USHORT nLastDrive=(USHORT)(-1), nResult;
  511.     ULONG lMap;
  512. !   BYTE bData[64];
  513. !   char bName[3];
  514.   #ifdef __32BIT__
  515.     ULONG nDrive, cbData;
  516.     PFSQBUFFER2 pData = (PFSQBUFFER2) bData;
  517. ***************
  518. *** 689,698 ****
  519.     PFSQBUFFER pData = (PFSQBUFFER) bData;
  520.   #endif
  521.   
  522. -   if ( _osmode == DOS_MODE )
  523. -     return TRUE;
  524. -   else
  525. -   {
  526.       /* We separate FAT and HPFS+other file systems here.
  527.          at the moment I consider other systems to be similar to HPFS,
  528.          i.e. support long file names and case sensitive */
  529. --- 688,693 ----
  530. ***************
  531. *** 713,725 ****
  532.       cbData = sizeof(bData);
  533.   
  534.       if ( !DosQueryFSAttach(bName, 0, FSAIL_QUERYNAME, (PVOID) pData, &cbData) )
  535. !       nResult = !strcmp(pData -> szFSDName + pData -> cbName, "FAT");
  536.       else
  537.         nResult = FALSE;
  538.   
  539.       /* End of this ugly code */
  540.       return nResult;
  541. -   }
  542.   } /* end function IsFileSystemFAT() */
  543.   
  544.   
  545. --- 708,719 ----
  546.       cbData = sizeof(bData);
  547.   
  548.       if ( !DosQueryFSAttach(bName, 0, FSAIL_QUERYNAME, (PVOID) pData, &cbData) )
  549. !     nResult = !strcmp((char *) (pData -> szFSDName) + pData -> cbName, "FAT");
  550.       else
  551.         nResult = FALSE;
  552.   
  553.       /* End of this ugly code */
  554.       return nResult;
  555.   } /* end function IsFileSystemFAT() */
  556.   
  557.   
  558. ***************
  559. *** 1398,1404 ****
  560.       ULONG action;
  561.   #else
  562.       USHORT rc;
  563. !     UINT action;
  564.   #endif
  565.   
  566.   
  567. --- 1392,1398 ----
  568.       ULONG action;
  569.   #else
  570.       USHORT rc;
  571. !     USHORT action;
  572.   #endif
  573.   
  574.   
  575. ***************
  576. *** 1579,1597 ****
  577.     eaop.fpGEAList = NULL;
  578.     eaop.oError = 0;
  579.   
  580. !   strcpy(fealst.szName, ".LONGNAME");
  581. !   strcpy(fealst.szValue, longname);
  582.   
  583. !   fealst.cbList  = sizeof(fealst) - CCHMAXPATH + strlen(fealst.szValue);
  584. !   fealst.cbName  = (BYTE) strlen(fealst.szName);
  585. !   fealst.cbValue = sizeof(USHORT) * 2 + strlen(fealst.szValue);
  586.   
  587.   #ifdef __32BIT__
  588.     fealst.oNext   = 0;
  589.   #endif
  590.     fealst.fEA     = 0;
  591.     fealst.eaType  = 0xFFFD;
  592. !   fealst.eaSize  = strlen(fealst.szValue);
  593.   
  594.     return DosSetPathInfo(name, FIL_QUERYEASIZE,
  595.                           (PBYTE) &eaop, sizeof(eaop), 0);
  596. --- 1573,1591 ----
  597.     eaop.fpGEAList = NULL;
  598.     eaop.oError = 0;
  599.   
  600. !   strcpy((char *) fealst.szName, ".LONGNAME");
  601. !   strcpy((char *) fealst.szValue, longname);
  602.   
  603. !   fealst.cbList  = sizeof(fealst) - CCHMAXPATH + strlen((char *) fealst.szValue);
  604. !   fealst.cbName  = (BYTE) strlen((char *) fealst.szName);
  605. !   fealst.cbValue = sizeof(USHORT) * 2 + strlen((char *) fealst.szValue);
  606.   
  607.   #ifdef __32BIT__
  608.     fealst.oNext   = 0;
  609.   #endif
  610.     fealst.fEA     = 0;
  611.     fealst.eaType  = 0xFFFD;
  612. !   fealst.eaSize  = strlen((char *) fealst.szValue);
  613.   
  614.     return DosSetPathInfo(name, FIL_QUERYEASIZE,
  615.                           (PBYTE) &eaop, sizeof(eaop), 0);
  616. ***************
  617. *** 1880,1886 ****
  618.   
  619.     if (!bInitialized)
  620.       InitNLS();
  621. !   for ( szPtr = szArg; *szPtr; szPtr++ )
  622.       *szPtr = cLowerCase[*szPtr];
  623.     return szArg;
  624.   }
  625. --- 1874,1880 ----
  626.   
  627.     if (!bInitialized)
  628.       InitNLS();
  629. !   for ( szPtr = (unsigned char *) szArg; *szPtr; szPtr++ )
  630.       *szPtr = cLowerCase[*szPtr];
  631.     return szArg;
  632.   }
  633. diff -cbr unzip/unzip.h unzip-2/unzip.h
  634. *** unzip/unzip.h    Sun Jul 31 20:09:44 1994
  635. --- unzip-2/unzip.h    Tue Aug 02 11:48:56 1994
  636. ***************
  637. *** 437,447 ****
  638. --- 437,449 ----
  639.   #endif
  640.   
  641.   #ifdef __WATCOMC__
  642. + #  ifdef __386__
  643.   #  define __32BIT__
  644.   #  undef far
  645.   #  define far
  646.   #  undef near
  647.   #  define near
  648. + #  endif
  649.   #  define PIPE_ERROR (errno == -1)
  650.   #endif
  651.   
  652. ***************
  653. *** 770,776 ****
  654.   #endif
  655.   
  656.   /* GRR:  NT defines MSDOS?? */
  657. ! #if (!defined(MSDOS) && !defined(__IBMC__)) || defined(NT)
  658.   #  define near
  659.   #  define far
  660.   #endif
  661. --- 772,778 ----
  662.   #endif
  663.   
  664.   /* GRR:  NT defines MSDOS?? */
  665. ! #if (!defined(MSDOS) && !defined(__IBMC__) && defined(__32BIT__)) || defined(NT)
  666.   #  define near
  667.   #  define far
  668.   #endif
  669.