diff -u 202\attribs.c .\attribs.c
--- 202\attribs.c	Thu Dec 16 15:22:26 1999
+++ .\attribs.c	Wed Oct 12 19:55:48 2005
@@ -123,7 +123,11 @@
 {
     char error_buf[80];
     int bg = parse_abbrev(src), fg;
+#ifdef __WIN32__
+    if(bg == -1)
+#else
     if(bg == -1 || bg >= 8)
+#endif
     {   sprintf(error_buf, "%.2s is not a valid background color", src);
         error_msg(error_buf);
     }
diff -u 202\console.c .\console.c
--- 202\console.c	Thu Dec 16 18:20:50 1999
+++ .\console.c	Wed Oct 12 19:30:20 2005
@@ -11,6 +11,11 @@
 #include "minitrue.h"
 #include "ansiesc.h"
 
+#ifdef __WIN32__
+#include <windows.h>
+static int top_line;
+#endif
+
 typedef struct
 {   int mode;    /* video mode */
     int cols;    /* number of columns on screen */
@@ -24,7 +29,9 @@
 Scrn Orig_screen  = {-1, -1, -1, -1, -1, -1};
 static ScreenPtr Capture_buf; /* Buffer containing contents of captured
                                * screen */
+#ifndef __MSDOS__
 static int Raw_mode;
+#endif
 static int Written;           /* Set if screen has been written to */
 static char *Term_buf;        /* Buffer for termcap data */
 
@@ -42,6 +49,7 @@
 {   (char *)TRUE, "\033[%i%d;%dH", "\033[K", NULL, "\n", NULL,
     NULL, NULL, "\033[0m", "\033[7m", "\033[1m", "\033[4m" };
 
+#ifndef __MSDOS__
 static char *Cap_names[] =
 {   "am", "cm", "ce", "sr", "sf", "cs",
     "ti", "te", "me", "mr", "md", "us",
@@ -49,6 +57,7 @@
     "kl", "kr", "kP", "kN",
     "kh", "@7", "kI", "kD",
 };
+#endif
 
 #ifdef __MSDOS__
 static int Tty = FALSE;       /* default in MSDOS is to write directly to
@@ -239,9 +248,21 @@
     reset_term();
 
     if(restore_screen && Capture_buf && !Tty)
-    {   int line;
+    {
+#ifdef __WIN32__
+        COORD buf, pos;
+        CONSOLE_SCREEN_BUFFER_INFO csbi;
+        buf.X = Orig_screen.cols;
+        buf.Y = Orig_screen.rows;
+        pos.X = pos.Y = 0;
+        GetConsoleScreenBufferInfo(GetStdHandle(STD_ERROR_HANDLE), &csbi);
+        WriteConsoleOutput(GetStdHandle(STD_ERROR_HANDLE), Capture_buf, buf,
+                           pos, &csbi.srWindow);
+#else
+        int line;
         for(line = 0; line < Orig_screen.rows; ++line)
             vmem_writeln(&Capture_buf[line * Orig_screen.cols], line);
+#endif
         Console_Move_cursor(Orig_screen.curx ? Orig_screen.curx - 1: 0,
                             Orig_screen.cury);
     }
@@ -456,6 +477,81 @@
 
  /* if key '\0' keypad key pressed, read next key to determine keypad char */
     return ch ? ch : get_keypad(Console_Get_key());
+}
+
+/* ====================== Win32 specific functions ======================= */
+
+#elif defined (__WIN32__)
+#include <conio.h>
+
+static void get_screen_info(Scrn *screen)
+{
+    CONSOLE_SCREEN_BUFFER_INFO ti;
+    GetConsoleScreenBufferInfo(GetStdHandle(STD_ERROR_HANDLE), &ti);
+    screen->mode = 3;
+    screen->rows = ti.srWindow.Bottom - ti.srWindow.Top + 1;
+    screen->cols = ti.dwSize.X;
+    screen->curx = ti.dwCursorPosition.X;
+    screen->cury = ti.dwCursorPosition.Y;
+    screen->attr = (char)ti.wAttributes;
+    top_line = ti.srWindow.Top;
+}
+
+static void vmem_writeln(ScreenPtr line_buf, int line)
+{
+    HANDLE con = GetStdHandle(STD_ERROR_HANDLE);
+    char str[256];
+    WORD attr[256];
+    COORD c;
+    int j;
+    DWORD dummy;
+
+    for(j = 0; j < Screen.cols; ++j)
+    {   str[j] = line_buf[j].ch;
+        attr[j] = line_buf[j].attr;
+    }
+    c.X = 0;
+    c.Y = line + top_line;
+    WriteConsoleOutputCharacter(con, str, Screen.cols, c, &dummy);
+    WriteConsoleOutputAttribute(con, attr, Screen.cols, c, &dummy);
+}
+
+static void bios_move_cursor(int x, int y)
+{
+    COORD c;
+    c.X = x;
+    c.Y = y + top_line;
+    SetConsoleCursorPosition(GetStdHandle(STD_ERROR_HANDLE), c);
+}
+
+#include <signal.h>
+
+static void set_term()
+{
+    int screen_size;
+    COORD buf, pos;
+    CONSOLE_SCREEN_BUFFER_INFO csbi;
+    Console_Resize();
+    screen_size = Screen.rows * Screen.cols * sizeof(CHAR_INFO);
+    freopen("CON", "rb", stdin);
+    Capture_buf     = x_farrealloc(Capture_buf, screen_size);
+    buf.X = Screen.cols;
+    buf.Y = Screen.rows;
+    pos.X = pos.Y = 0;
+    GetConsoleScreenBufferInfo(GetStdHandle(STD_ERROR_HANDLE), &csbi);
+    ReadConsoleOutput(GetStdHandle(STD_ERROR_HANDLE), Capture_buf, buf, pos,
+                      &csbi.srWindow);
+}
+static void reset_term() {}
+
+int Console_Get_key()
+{
+    int ch = getch();
+    if(ch == '\003')
+        raise(SIGINT);
+
+ /* if key 224 keypad key pressed, read next key to determine keypad char */
+    return (ch != 224) ? ch : get_keypad(Console_Get_key());
 }
 #endif /* __MSDOS__ */
 
diff -u 202\dirwalk.c .\dirwalk.c
--- 202\dirwalk.c	Thu Dec 16 18:16:38 1999
+++ .\dirwalk.c	Tue Oct 18 02:21:24 2005
@@ -84,6 +84,7 @@
     basename_upcase += 0; /* dummy statement to avoid warning */
 #else
     int dir_i;
+#ifndef __WIN32__
  /* If long file names not used, set filenames to lower case unless upper
   *   case letters in base directory */
     char *lfn_env = getenv("LFN");
@@ -97,6 +98,7 @@
         if(!start_dir || !start_dir[dir_i])
             dw->flags |= DW_LC_CONV;
     }
+#endif
  /* Use / as path separator in DOS filenames if used in start_dir,
   *   otherwise use \ */
     dw->path_sep_ch = '\\';
@@ -238,7 +240,89 @@
     return finfo_i;
 }
 
-#ifdef __MSDOS__
+#ifdef __WIN32__
+#include <io.h>
+/* Open the subdirectory corresponding to the level pointed to by lev_ptr */
+static int open_subdir(DirWalk *dw, DirLevel far *lev_ptr)
+{
+    int attr       = _A_NORMAL | _A_ARCH | _A_RDONLY;
+    fdata_t fdata;
+    HANDLE find;
+
+    if(!(dw->flags & DW_REGFILE))
+        attr |= _A_SYSTEM;
+    if(dw->level <= dw->level_max)
+        attr |= _A_SUBDIR;
+    if(dw->flags & DW_HIDDEN)
+        attr |= _A_HIDDEN; /* _A_HIDDEN; */
+
+    path_append(dw, "*.*", 3, dw->path_len);
+
+    find = x_findfirst(dw->path, &fdata);
+    if(find == INVALID_HANDLE_VALUE)
+        return FALSE;
+
+ /* Skip over . and .. , will be present in all directories except root */
+    do {
+        FInfo far *finfo_ptr;
+        if(   fdata.cFileName[0] == '.'
+           && (!fdata.cFileName[1]
+               || (fdata.cFileName[1] == '.' && !fdata.cFileName[2])))
+            continue;
+
+        if((fdata.dwFileAttributes & _A_SYSTEM) && !(attr & _A_SYSTEM))
+            continue;
+        if((fdata.dwFileAttributes & _A_SUBDIR) && !(attr & _A_SUBDIR))
+            continue;
+        if((fdata.dwFileAttributes & _A_HIDDEN) && !(attr & _A_HIDDEN))
+            continue;
+
+     /* Write file size and attribute to finfo array in addition to filename*/
+        finfo_ptr = Resizer_ptr(&dw->finfo, add_fname(dw, fdata.cFileName));
+        finfo_ptr->attrib   = fdata.dwFileAttributes;
+        finfo_ptr->size     = fdata.nFileSizeLow;
+        finfo_ptr->cr_time  = fdata.ftCreationTime;
+        finfo_ptr->acc_time = fdata.ftLastAccessTime;
+        finfo_ptr->mod_time = fdata.ftLastWriteTime;
+
+    }while(FindNextFile(find, &fdata));
+    FindClose(find);
+
+    return TRUE;
+}
+
+static int read_subdir(DirWalk *dw, fdata_t *fdata_ptr, int *got_fdata)
+{
+    DirLevel far *lev_ptr  = Resizer_ptr(&dw->levels, dw->level);
+
+    while(lev_ptr->finfo_i < Resizer_size(&dw->finfo))
+    {   FInfo far *finfo   = Resizer_ptr(&dw->finfo, lev_ptr->finfo_i);
+        char far *fname    = Resizer_ptr(&dw->fnames, finfo->name_i);
+        ++lev_ptr->finfo_i;
+     /* Append basename to path */
+        path_append(dw, fname, finfo->name_len, lev_ptr->base_name_i);
+        if((finfo->attrib & _A_SUBDIR) && lev_ptr->done != SKIP_SUBDIRS)
+        {   int finfo_i = lev_ptr->finfo_i - 1;
+            if(dw->flags & DW_DEPTH)
+                lev_ptr = descend_subdir(dw, finfo_i, dw->level + 1);
+            else
+                Resizer_append(&dw->subdirs, &finfo_i, 1);
+            continue;
+        }
+        else if(dw->level >= dw->level_min && !lev_ptr->done)
+        {   *got_fdata = GOT_FDATA;
+            fdata_ptr->dwFileAttributes = finfo->attrib;
+            fdata_ptr->nFileSizeLow     = finfo->size;
+            fdata_ptr->ftCreationTime   = finfo->cr_time;
+            fdata_ptr->ftLastAccessTime = finfo->acc_time;
+            fdata_ptr->ftLastWriteTime  = finfo->mod_time;
+            return TRUE;
+        }
+    }
+    return FALSE;
+}
+
+#elif defined(__MSDOS__)
 #include <dos.h>
 /* Open the subdirectory corresponding to the level pointed to by lev_ptr */
 static int open_subdir(DirWalk *dw, DirLevel far *lev_ptr)
@@ -261,18 +345,19 @@
  /* Skip over . and .. , will be present in all directories except root */
     do {
         FInfo far *finfo_ptr;
-        if(   fdata.name[0] == '.'
-           && (!fdata.name[1] || (fdata.name[1] == '.' && !fdata.name[2])))
+        if(   fdata.ff_name[0] == '.'
+           && (!fdata.ff_name[1]
+               || (fdata.ff_name[1] == '.' && !fdata.ff_name[2])))
             continue;
 
      /* Write file size and attribute to finfo array in addition to filename*/
-        finfo_ptr = Resizer_ptr(&dw->finfo, add_fname(dw, fdata.name));
-        finfo_ptr->attrib = fdata.attrib;
-        finfo_ptr->size   = fdata.size;
-        finfo_ptr->date   = fdata.wr_date;
-        finfo_ptr->time   = fdata.wr_time;
+        finfo_ptr = Resizer_ptr(&dw->finfo, add_fname(dw, fdata.ff_name));
+        finfo_ptr->attrib = fdata.ff_attrib;
+        finfo_ptr->size   = fdata.ff_fsize;
+        finfo_ptr->date   = fdata.ff_fdate;
+        finfo_ptr->time   = fdata.ff_ftime;
 
-    }while(!_dos_findnext(&fdata));
+    }while(!findnext(&fdata));
 
     return TRUE;
 }
@@ -297,10 +382,10 @@
         }
         else if(dw->level >= dw->level_min && !lev_ptr->done)
         {   *got_fdata = GOT_FDATA;
-            fdata_ptr->attrib  = finfo->attrib;
-            fdata_ptr->size    = finfo->size;
-            fdata_ptr->wr_date = finfo->date;
-            fdata_ptr->wr_time = finfo->time;
+            fdata_ptr->ff_attrib = finfo->attrib;
+            fdata_ptr->ff_fsize  = finfo->size;
+            fdata_ptr->ff_fdate  = finfo->date;
+            fdata_ptr->ff_ftime  = finfo->time;
             return TRUE;
         }
     }
diff -u 202\dirwalk.h .\dirwalk.h
--- 202\dirwalk.h	Thu Dec 16 18:16:38 1999
+++ .\dirwalk.h	Sat Oct 15 11:21:32 2005
@@ -13,7 +13,13 @@
     int name_i;    /* starting index for filename in fnames buffer */
     int name_len;  /* length of filename, includes trailing '\0' */
 
-#ifdef __MSDOS__   /* extract these values from find_t structure */
+#ifdef __WIN32__
+    DWORD size;             /* size of file */
+    DWORD attrib;           /* file attribute */
+    FILETIME cr_time;       /* creation time */
+    FILETIME acc_time;      /* last accessed time */
+    FILETIME mod_time;      /* last modified time */
+#elif defined(__MSDOS__)  /* extract these values from find_t structure */
     long size;     /* size of file */
     char attrib;   /* file attribute */
     unsigned date; /* last modified date */
diff -u 202\fileops.c .\fileops.c
--- 202\fileops.c	Thu Dec 16 15:16:34 1999
+++ .\fileops.c	Sun Oct 16 03:49:08 2005
@@ -31,6 +31,9 @@
 #define close _close
 #define read  _read
 #define write _write
+# ifdef __WIN32__
+int _fmode = O_BINARY;
+# endif
 #endif
 
 enum { NEXT_FILE = 0, RETRY = 1 };
@@ -126,13 +129,21 @@
 /* return the maximum filename length for the where filesystem fdesc is found*/
 int fname_max(file_t fdesc)
 {
+#ifdef __WIN32__
+    return 255;
+#else
     return fpathconf(fdesc, _PC_NAME_MAX);
+#endif
 }
 
 /* return the maximum path length of the file system where fname is found */
 static int path_max(const char *fname)
 {
+#ifdef __WIN32__
+    return 260;
+#else
     return pathconf(fname, _PC_PATH_MAX);
+#endif
 }
 
 /* Need to use _dos_read/write because they accept far pointers */
@@ -349,11 +360,98 @@
 {
     return unzipped ? FALSE : S_ISREG(st->st_mode);
 }
+#elif defined(__WIN32__)
+
+HANDLE x_findfirst(const char *fname, fdata_t *fdata)
+{
+    HANDLE find;
+    if((find = FindFirstFile(fname, fdata)) == INVALID_HANDLE_VALUE)
+        file_error(fname);
+    return find;
+}
+
+/* Get only the file attribute, store in attribute field of fdata */
+int x_get_fattr(const char *fname, fdata_t *fdata)
+{
+    DWORD fattr = GetFileAttributes(fname);
+    if(fattr == ~0)
+        file_error(fname);
+    fdata->dwFileAttributes = fattr;
+    return (int)fattr;
+}
+
+/* Get the time stamp of the file */
+int x_get_ftime(int fdesc, fdata_t *fdata)
+{
+    BY_HANDLE_FILE_INFORMATION fi;
+    if(!GetFileInformationByHandle((HANDLE)_get_osfhandle(fdesc), &fi))
+    {   file_error(NULL);
+        return -1;
+    }
+    fdata->ftCreationTime   = fi.ftCreationTime;
+    fdata->ftLastAccessTime = fi.ftLastAccessTime;
+    fdata->ftLastWriteTime  = fi.ftLastWriteTime;
+    return 0;
+}
+
+/* Set the file attributes of dest to those of src. If clone_ftime is set,
+ *   copy the file time as well */
+int x_clone(const char *fname, fdata_t *fdata, int clone_ftime)
+{
+    if(!SetFileAttributes(fname, fdata->dwFileAttributes))
+    {   file_error(fname);
+        return -1;
+    }
+    else
+    {   if(clone_ftime)
+        {   int fdesc = open(fname, O_RDWR);
+            if(!SetFileTime((HANDLE)_get_osfhandle(fdesc),
+                            &fdata->ftCreationTime,
+                            &fdata->ftLastAccessTime,
+                            &fdata->ftLastWriteTime))
+            {   file_error(fname);
+                return -1;
+            }
+            x_close(fdesc);
+        }
+        return 0;
+    }
+}
+
+/* Make the file permissions of the file fname normal */
+int x_norm_perms(const char *fname) { return 0; }
+
+/* Get the current drive, A = 1, B = 2, .. */
+#include <direct.h>
+int x_get_drive(void)
+{
+    return _getdrive();
+}
+
+/* In MSDOS, compare filenames case insensitively */
+int fname_cmp(const char far *fname1, const char far *fname2)
+{
+    return _fstricmp(fname1, fname2);
+}
+
+int x_can_write_dir(const char *dir) { return TRUE; }
+
+int fdata_seekable(fdata_t *fdata, int unzipped) { return TRUE; }
+off_t fdata_size(fdata_t *fdata){ return fdata->nFileSizeLow; }
+int fdata_isdir(fdata_t *fdata) { return fdata->dwFileAttributes & _A_SUBDIR; }
+int fdata_isreg(fdata_t *fdata) { return fdata->dwFileAttributes &(_A_NORMAL|_A_ARCH);}
+
+/* Including this variable will suppress automatic wildcard expansion for
+ *   the MinGW version */
+#ifdef __MINGW32__
+int _CRT_glob = 0;
+#endif
+
 #else
 
 int x_findfirst(const char *fname, int attr, fdata_t *fdata)
 {
-    if(_dos_findfirst((char *)fname, attr, fdata))
+    if(findfirst((char *)fname, fdata, attr))
     {   file_error(fname);
         return -1;
     }
@@ -364,21 +462,23 @@
 /* Get only the file attribute, store in attribute field of fdata */
 int x_get_fattr(const char *fname, fdata_t *fdata)
 {
-    unsigned fattr;
-    int err_code = _dos_getfileattr(fname, &fattr);
-    if(err_code)
+    int fattr = _chmod(fname, 0);
+    if(fattr == -1)
         file_error(fname);
-    fdata->attrib = fattr;
-    return err_code;
+    fdata->ff_attrib = fattr;
+    return fattr;
 }
 
 /* Get the time stamp of the file */
 int x_get_ftime(int fdesc, fdata_t *fdata)
 {
-    if(_dos_getftime(fdesc, &fdata->wr_date, &fdata->wr_time))
+    unsigned d, t;
+    if(_dos_getftime(fdesc, &d, &t))
     {   file_error(NULL);
         return -1;
     }
+    fdata->ff_fdate = (unsigned short)d;
+    fdata->ff_ftime = (unsigned short)t;
     return 0;
 }
 
@@ -386,14 +486,14 @@
  *   copy the file time as well */
 int x_clone(const char *fname, fdata_t *fdata, int clone_ftime)
 {
-    if(_dos_setfileattr(fname, fdata->attrib))
+    if(_chmod(fname, 1, fdata->ff_attrib) == -1)
     {   file_error(fname);
         return -1;
     }
     else
     {   if(clone_ftime)
         {   int fdesc = x_open(fname);
-            if(_dos_setftime(fdesc, fdata->wr_date, fdata->wr_time))
+            if(_dos_setftime(fdesc, fdata->ff_fdate, fdata->ff_ftime))
             {   file_error(fname);
                 return -1;
             }
@@ -423,9 +523,9 @@
 int x_can_write_dir(const char *dir) { return TRUE; }
 
 int fdata_seekable(fdata_t *fdata, int unzipped) { return TRUE; }
-off_t fdata_size(fdata_t *fdata){ return fdata->size; }
-int fdata_isdir(fdata_t *fdata) { return fdata->attrib & _A_SUBDIR; }
-int fdata_isreg(fdata_t *fdata) { return fdata->attrib & (_A_NORMAL |_A_ARCH);}
+off_t fdata_size(fdata_t *fdata){ return fdata->ff_fsize; }
+int fdata_isdir(fdata_t *fdata) { return fdata->ff_attrib & _A_SUBDIR; }
+int fdata_isreg(fdata_t *fdata) { return fdata->ff_attrib &(_A_NORMAL|_A_ARCH);}
 
 /* Including this function will suppress automatic wildcard expansion for
  *   the DJGPP version */
diff -u 202\fileops.h .\fileops.h
--- 202\fileops.h	Thu Dec 16 15:16:34 1999
+++ .\fileops.h	Sat Oct 15 11:27:46 2005
@@ -18,9 +18,19 @@
 int x_fstat(int fdesc, fdata_t *fdata);
 int x_lstat(const char *fname, fdata_t *fdata);
 #else
+#include <dir.h>
 #include <dos.h>
-typedef struct find_t fdata_t;
+#ifdef __WIN32__
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <fcntl.h>
+#undef FILE_END                 /* used by regexp.h */
+typedef WIN32_FIND_DATA fdata_t;
+HANDLE x_findfirst(const char *path, fdata_t *fdata);
+#else
+typedef struct ffblk fdata_t;
 int x_findfirst(const char *path, int attr, fdata_t *fdata);
+#endif
 #endif
 
 void FileOps_Init(char *ignore_errors);
diff -u 202\files.c .\files.c
--- 202\files.c	Thu Dec 16 15:16:24 1999
+++ .\files.c	Sun Oct 16 03:30:32 2005
@@ -184,6 +184,9 @@
         Scan_stdin     = FALSE;
         In_file.flags |= STDIN_PIPE;
         In_file.desc   = Stdin_dup;
+#ifdef __WIN32__
+        setmode(Stdin_dup, _O_BINARY);
+#endif
         process_fdata(&In_file, got_fdata);
     }
  /* Then go through files listed on the command line */
@@ -319,11 +322,20 @@
             x_fstat(files->desc, &files->fdata);
 
 #else
-    {   files->fdata.size = x_seekend(files->desc);
+    {
+#ifdef __WIN32__
+        files->fdata.nFileSizeLow = x_seekend(files->desc);
+#else
+        files->fdata.ff_fsize = x_seekend(files->desc);
+#endif
         x_seek(files->desc, 0);
         if(got_fdata != GOT_FATTR)
         {   if(files->flags & (UNZIP_PIPE | STDIN_PIPE))
-                files->fdata.attrib = _A_NORMAL;
+#ifdef __WIN32__
+                files->fdata.dwFileAttributes = _A_NORMAL;
+#else
+                files->fdata.ff_attrib = _A_NORMAL;
+#endif
             else
                 x_get_fattr(files->name, &files->fdata);
         }
@@ -418,6 +430,9 @@
     if(pad_page && (int)pad_page != -1)
         munmap(pad_page, page_len);
     return miN(files->size, files->nread) - orig_nread;
+#else
+    *end = NULL;
+    return 0;
 #endif /* mmap */
 }
 
diff -u 202\hilites.c .\hilites.c
--- 202\hilites.c	Thu Dec 16 18:21:02 1999
+++ .\hilites.c	Tue Oct 11 21:29:20 2005
@@ -166,8 +166,8 @@
 {
  /* Boundary values at start & end, needed for binary search */
     static Hilite Bounds[2] =
-    {   {0,       0, 0, 0, 0, NULL},
-        {OFF_MAX, 0, 0, 0, 1, NULL}
+    {   {0,       0, 0, 0, 0, NULL, 0},
+        {OFF_MAX, 0, 0, 0, 1, NULL, 0}
     };
  /* Allocate memory if not allocated, start with 1024 highlights */
     if(!Nalloc)
diff -u 202\makefile.dj .\makefile.dj
--- 202\makefile.dj	Thu Dec 16 18:22:42 1999
+++ .\makefile.dj	Sat Oct 15 11:27:30 2005
@@ -10,8 +10,8 @@
   stdout.o viewer.o lines.o console.o statline.o winbuf.o hilites.o \
   attribs.o linenums.o scroll.o signals.o resizer.o
 
-mtr: $(OBJFILES)
-	gcc -o mtr $(LIBS) $(OBJFILES)
+mtr.exe: $(OBJFILES)
+	gcc -o mtr.exe $(LIBS) $(OBJFILES)
 
 minitrue.o: minitrue.h buffers.h strings.h flags.h files.h hilites.h \
 	viewer.h console.h attribs.h charset.h lines.h signals.h
diff -u 202\minitrue.c .\minitrue.c
--- 202\minitrue.c	Thu Dec 16 15:16:10 1999
+++ .\minitrue.c	Tue Dec 27 23:53:56 2005
@@ -144,8 +144,9 @@
 }
 
 static char far Copyright_text[] =
-"Copyright (C) 1995-99 Andrew Pipkin  minitrue@pagesz.net\n\
+"Copyright (C) 1995-99 Andrew Pipkin  minitrue@idiotsdelight.net\n\
 MiniTrue is free software released with no warranty. See COPYING for details.\n\
+This release by Jason Hood <jadoxa@yahoo.com.au>.\n\
 \n\
 Usage: " EXE_NAME " [-options] [files] - [strings]\n\
 \n\
@@ -175,6 +176,8 @@
     char *mt_env = getenv("MINITRUE");
 #ifdef __DJGPP__
     char *platform_name = "32-bit DOS";
+#elif defined(__WIN32__)
+    char *platform_name = "32-bit Windows";
 #elif defined(__MSDOS__)
     char *platform_name = "16-bit DOS";
 #else
diff -u 202\minitrue.h .\minitrue.h
--- 202\minitrue.h	Thu Dec 16 15:16:14 1999
+++ .\minitrue.h	Wed Oct 12 16:22:04 2005
@@ -44,7 +44,14 @@
  * functions */
 #else
 #ifndef __DJGPP__
-#define __UNIX__
+# if !defined(__WIN32__) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32))
+#  define __WIN32__
+# else
+#  define __UNIX__
+# endif /* __WIN32__ */
+#ifdef __WIN32__
+# define __MSDOS__
+#endif
 #endif /* __DJGPP__ */
 # define farmalloc  malloc
 #define farrealloc realloc
diff -u 202\rxfind.c .\rxfind.c
--- 202\rxfind.c	Tue Dec 21 07:52:14 1999
+++ .\rxfind.c	Tue Oct 11 21:29:20 2005
@@ -462,7 +462,7 @@
           case NEG_CHAR_SET:
             {   size_t bytes_after = Buf_end - match_end;
                 size_t n = ((bytes_after >= (size_t)rx_ptr->max)
-                            ? rx_ptr->max
+                            ? (size_t)rx_ptr->max
                             : bytes_after);
                 const char *set_end = memchr(match_end, rx_ptr->data.ch, n);
                 if(!set_end)
@@ -494,7 +494,7 @@
           case NEG_CHAR_SET_REV:
             {   size_t bytes_before = match_start - search_start;
                 size_t n = ((bytes_before >= (size_t)rx_ptr->max)
-                            ? rx_ptr->max
+                            ? (size_t)rx_ptr->max
                             : bytes_before);
                 const char *set_start = memrchr(match_start - n,
                                                 rx_ptr->data.ch, n);
@@ -851,7 +851,11 @@
 
           case LINE_START:
             if(match_end != Buf_start)
-                rx_ptr = (match_end[-1] == NL) ? ++rx_ptr : rx_ptr->fail.ptr;
+            {   if(match_end[-1] == NL)
+                    ++rx_ptr;
+                else
+                    rx_ptr = rx_ptr->fail.ptr;
+            }
             else if(Buf_loc & BUF_BOF)
                 ++rx_ptr;
             else
@@ -860,7 +864,11 @@
 
           case LINE_END:
             if(match_end != Buf_end)
-                rx_ptr = (*match_end == NL) ? ++rx_ptr : rx_ptr->fail.ptr;
+            {   if(*match_end == NL)
+                    ++rx_ptr;
+                else
+                    rx_ptr = rx_ptr->fail.ptr;
+            }
             else if(Buf_loc & BUF_EOF)
                 ++rx_ptr;
             else
@@ -869,7 +877,11 @@
 
           case LINE_START_REV:
             if(match_start != Buf_start)
-                rx_ptr = (match_start[-1] == NL) ? ++rx_ptr : rx_ptr->fail.ptr;
+            {   if(match_start[-1] == NL)
+                    ++rx_ptr;
+                else
+                    rx_ptr = rx_ptr->fail.ptr;
+            }
             else if(Buf_loc & BUF_BOF)
                 ++rx_ptr;
             else
@@ -878,7 +890,11 @@
 
           case LINE_END_REV:
             if(match_start != Buf_end)
-                rx_ptr = (*match_start == NL) ? ++rx_ptr : rx_ptr->fail.ptr;
+            {   if(*match_start == NL)
+                    ++rx_ptr;
+                else
+                    rx_ptr = rx_ptr->fail.ptr;
+            }
             else if(Buf_loc & BUF_EOF)
                 ++rx_ptr;
             else
diff -u 202\rxsubst.c .\rxsubst.c
--- 202\rxsubst.c	Thu Dec 16 18:19:58 1999
+++ .\rxsubst.c	Tue Oct 11 21:29:20 2005
@@ -188,15 +188,19 @@
         {   char *lc_ptr = &Subst_buf[buf_i];
             int nlc = miN(sub_str_len, nlow_case);
             nlow_case -= nlc;
-            while(nlc--)
-                *lc_ptr = low_casE(*lc_ptr++);
+            while(nlc--) {
+                *lc_ptr = low_casE(*lc_ptr);
+                ++lc_ptr;
+            }
         }
         else if(nup_case)
         {   char *uc_ptr = &Subst_buf[buf_i];
             int nuc = miN(sub_str_len, nup_case);
             nup_case -= nuc;
-            while(nuc--)
-                *uc_ptr = up_casE(*uc_ptr++);
+            while(nuc--) {
+                *uc_ptr = up_casE(*uc_ptr);
+                ++uc_ptr;
+            }
         }
         buf_i += sub_str_len;
     }
diff -u 202\signals.c .\signals.c
--- 202\signals.c	Sun Nov 07 06:36:42 1999
+++ .\signals.c	Tue Oct 11 21:29:20 2005
@@ -11,9 +11,13 @@
 #include "strings.h"
 
 static void abort_prog(int signum);
+#ifdef SIGTSTP
 static void susp_handler(int sig_num);
 static void cont_handler(int sig_num);
+#endif
+#ifdef SIGWINCH
 static void resize_handler(int sig_num);
+#endif
 
 void Signals_Init(int need_console)
 {
diff -u 202\unzip.c .\unzip.c
--- 202\unzip.c	Thu Dec 16 18:16:52 1999
+++ .\unzip.c	Tue Oct 11 21:29:20 2005
@@ -24,7 +24,9 @@
 static int Unzip_fdesc = -1; /* File descriptor for capture file for unzipper*/
 char *Params_copy;           /* Copy of parameters */
 
+#ifndef __MSDOS__
 static int prog_in_path(char *prog_name);
+#endif
 static int open_pipe(char *unzip_argv[]);
 
 /* enumeration describes signifance of args in argument vector */
@@ -85,7 +87,8 @@
             Unzips[NUnzips].fname_i    = 1;
 
      /* Indicate end of argument vector with NULL */
-        Unzips[NUnzips++].argv[ Unzips[NUnzips].fname_i + 1] = NULL;
+        Unzips[NUnzips].argv[ Unzips[NUnzips].fname_i + 1] = NULL;
+        ++NUnzips;
 
      /* Continue if more sets of parameters */
         if(param_ptr && (param_ptr = strchr(param_ptr, PARAM_SEP)) != NULL)
@@ -95,11 +98,8 @@
 }
 
 /* See if the decompression program can be found in the path */
-#ifdef __MSDOS__
-enum {DIR_CH = '\\', PATH_CH = ';'};
-#else
+#ifndef __MSDOS__
 enum {DIR_CH = '/', PATH_CH = ':'};
-#endif
 static int prog_in_path(char *prog_name)
 {
     const char *path = getenv("PATH");
@@ -140,6 +140,7 @@
     }
     return FALSE;
 }
+#endif
 
 /* See if the extension of fname matches any of the specified compressed file
  * types. If it does, start the decompression program as a subprocess and
