Merge pull request #10 from ccawley2011/watcom
authorJames Woodcock <[email protected]>
Sat, 13 Jul 2019 19:30:35 +0000 (13 20:30 +0100)
committerGitHub <[email protected]>
Sat, 13 Jul 2019 19:30:35 +0000 (13 20:30 +0100)
Support compiling with OpenWatcom

1  2 
compress.c
io.c
unarc.c

diff --cc compress.c
@@@ -202,10 -208,10 +209,10 @@@ uncompress(Header *header, FILE *ifp, F
                                                                                          sizeof(unsigned short));
        if (!htab || !codetab)
        {
 -              fprintf(stderr, "%s: uncompress: out of memory\n", ourname);
 +              error("%s: uncompress: out of memory", ourname);
                exit(1);
        }
- #endif                                                        /* __MSDOS__ && ! BB_HUGE_STATIC_ARRAYS */
+ #endif                                                        /* ! BB_HUGE_STATIC_ARRAYS */
  
        crc = 0;
        clear_flg = 0;
                        *stackp++ = tab_suffixof(code);
                        code = tab_prefixof(code);
                }
-               /* BB changed next line for Borland C/C++ 4 */
-               /* *stackp++ = finchar = tab_suffixof(code); */
- #ifdef __MSDOS__
-               finchar = tab_suffixof(code);
-               *stackp++ = (char_type) finchar;
- #else
-               if ((char *)(stackp+1) > (char *)(&htab[0] + HSIZE))
+               if ((char NSHUGE *)(stackp+1) > (char NSHUGE *)(&htab[0] + HSIZE))
                {
 -                      fprintf(stderr, "%s: uncompress: corrupt or garbled archive file\n", ourname);
 +                      error("%s: uncompress: corrupt or garbled archive file", ourname);
                        exit(1);
                }
-               *stackp++ = finchar = tab_suffixof(code);
- #endif
+               /* BB changed next line for Borland C/C++ 4 */
+               /* *stackp++ = finchar = tab_suffixof(code); */
+               finchar = tab_suffixof(code);
+               *stackp++ = (char_type) finchar;
  
                /*
                 * And put them out in forward order
diff --cc io.c
Simple merge
diff --cc unarc.c
+++ b/unarc.c
@@@ -103,9 -107,8 +103,8 @@@ char prompt_user(char *filename)
  char *get_newname(void);
  
  
- #ifndef __MSDOS__
  int
 -do_unsquash(int to_stdout)
 +do_unsquash()
  {
        SqshHeader sqsh_header;
        Header header;