--- orig_source/util.c	Sat Jan  7 13:43:32 1995
+++ source/util.c	Sat Dec 23 17:51:22 1995
@@ -211,7 +211,7 @@
 #else
 
   /* Read access? */
-  if (strcmp(mode, "r") == 0) {
+  if (strchr(mode, 'r')) {
 	if (access(file, R_OK) < 0) return(NULL);
 	return(fopen(file, mode));
   }
--- orig_source/dial.c	Thu May 25 11:42:14 1995
+++ source/dial.c	Sat Dec 23 02:10:40 1995
@@ -133,7 +133,7 @@
 
   if (P_MINIT[0] == '\0') return;
 
-  w = tell("Initializing Modem");
+  w = wtell("Initializing Modem");
   m_dtrtoggle(portfd);
   mputs(P_MINIT, 0);
   wclose(w, 1);
@@ -148,7 +148,7 @@
 
   if (P_MRESET[0] == '\0') return;
 
-  w = tell("Resetting Modem");
+  w = wtell("Resetting Modem");
   mputs(P_MRESET, 0);
   sleep(1);
   wclose(w, 1);
@@ -161,7 +161,7 @@
 {
   WIN *w;
 
-  w = tell("Hanging up");
+  w = wtell("Hanging up");
 
   if (P_MDROPDTR[0] == 'Y') {
   	m_dtrtoggle(portfd);
@@ -182,7 +182,7 @@
 {
   WIN *w;
   
-  w = tell("Sending BREAK");
+  w = wtell("Sending BREAK");
   wcursor(w, CNONE);
 
   m_break(portfd);
@@ -575,7 +575,7 @@
   sprintf(dfile, "%s/.dialdir", homedir);
 
   /* Try to open ~/.dialdir */
-  if ((fp = sfopen(dfile, "r")) == (FILE *)NULL) {
+  if ((fp = sfopen(dfile, "rb")) == (FILE *)NULL) {
 	if (errno == EPERM) {
 		werror("Cannot open ~/.dialdir: permission denied");
 		dialents = mkstdent();
@@ -689,7 +689,7 @@
 
   sprintf(dfile, "%s/.dialdir", homedir);
 
-  if ((fp = sfopen(dfile, "w")) == (FILE *)0) {
+  if ((fp = sfopen(dfile, "wb")) == (FILE *)0) {
   	werror("Can't write to ~/.dialdir");
 	dendd = 1;
   	return;
--- orig_source/window.c	Thu Mar 30 19:15:44 1995
+++ source/window.c	Fri Dec 22 18:21:48 1995
@@ -325,7 +325,7 @@
  *                 0: only write to memory, not to screen
  *                 1: write to both screen and memory
  */
-static void _write(c, doit, x, y,attr, color)
+static void _stdwrite(c, doit, x, y,attr, color)
 int c, doit;
 int x, y;
 char attr, color;
@@ -536,27 +536,27 @@
 
   /* And draw the window */
   if (border) {
-	_write(border == BSINGLE ? S_UL : D_UL, w->direct, x1, y1,
+	_stdwrite(border == BSINGLE ? S_UL : D_UL, w->direct, x1, y1,
 					xattr, color);
 	for(x = x1 + 1; x < x2; x++)
-		_write(border == BSINGLE ? S_HOR : D_HOR, w->direct, x, y1,
+		_stdwrite(border == BSINGLE ? S_HOR : D_HOR, w->direct, x, y1,
 					xattr, color);
-	_write(border == BSINGLE ? S_UR : D_UR, w->direct, x2, y1,
+	_stdwrite(border == BSINGLE ? S_UR : D_UR, w->direct, x2, y1,
 					xattr, color);
 	for(y = y1 + 1; y < y2; y++) {
-		_write(border == BSINGLE ? S_VER : D_VER, w->direct, x1, y,
+		_stdwrite(border == BSINGLE ? S_VER : D_VER, w->direct, x1, y,
 					xattr, color);
 		for(x = x1 + 1; x < x2; x++)
-			_write(' ', w->direct, x, y, attr, color);
-		_write(border == BSINGLE ? S_VER : D_VER, w->direct, x2, y,
+			_stdwrite(' ', w->direct, x, y, attr, color);
+		_stdwrite(border == BSINGLE ? S_VER : D_VER, w->direct, x2, y,
 					xattr, color);
 	}
-	_write(border == BSINGLE ? S_LL : D_LL, w->direct, x1, y2,
+	_stdwrite(border == BSINGLE ? S_LL : D_LL, w->direct, x1, y2,
 					xattr, color);
 	for(x = x1 + 1; x < x2; x++)
-		_write(border == BSINGLE ? S_HOR : D_HOR, w->direct,
+		_stdwrite(border == BSINGLE ? S_HOR : D_HOR, w->direct,
 					x, y2, xattr, color);
-	_write(border == BSINGLE ? S_LR : D_LR, w->direct, x2, y2,
+	_stdwrite(border == BSINGLE ? S_LR : D_LR, w->direct, x2, y2,
 					xattr, color);
 	if (w->direct) _gotoxy(x1 + 1, y1 + 1);
   } else
@@ -597,7 +597,7 @@
   if (replace) {
 	for(y = win->y1; y <= win->y2; y++) {
   		for(x = win->x1; x <= win->x2; x++) {
-  			_write(e->value, 1, x, y, e->attr, e->color);
+  			_stdwrite(e->value, 1, x, y, e->attr, e->color);
   			e++;
   		}
  	}
@@ -664,7 +664,7 @@
   e = gmap;
   for(y = 0; y <LINES; y++) {
   	for(x = 0; x < COLS; x++) {
-  		_write(e->value, -1, x, y, e->attr, e->color);
+  		_stdwrite(e->value, -1, x, y, e->attr, e->color);
   		e++;
   	}
   }
@@ -704,7 +704,7 @@
 
   for(y = miny; y <= maxy; y++) {
   	for(x = minx; x <= maxx; x++) {
-  		_write(e->value, -1, x, y, e->attr, e->color);
+  		_stdwrite(e->value, -1, x, y, e->attr, e->color);
   		e++;
   	}
   	e += addcnt;
@@ -737,7 +737,7 @@
   	doit = 0;
   }
   for(x = w->curx + w->x1; x <= w->x2; x++) {
-  	_write(' ', (w->direct && doit) ? 1 : 0, x, y, w->attr, w->color);
+  	_stdwrite(' ', (w->direct && doit) ? 1 : 0, x, y, w->attr, w->color);
   }
   return(doit);	
 }
@@ -830,7 +830,7 @@
    */
   if (sflag && win->sy2 == (LINES - 1) && win->sy1 != win->sy2) {
   	if (dir == S_UP) {
-  		_write(oldc.value, 1, COLS - 1, LINES - 2,
+  		_stdwrite(oldc.value, 1, COLS - 1, LINES - 2,
   			oldc.attr, oldc.color);
   	}
   	sflag = 0;
@@ -891,7 +891,7 @@
   		for(y = win->sy1 + 1; y <= win->sy2; y++) {
   			e = gmap + y * COLS + win->x1;
   			for(x = win->x1; x <= win->x2; x++) {
-  			   _write(e->value, win->direct && doit,
+  			   _stdwrite(e->value, win->direct && doit,
   			   		x, y - 1, e->attr, e->color);
   			   e++;
  	 		}
@@ -903,7 +903,7 @@
   		for(y = win->sy2 - 1; y >= win->sy1; y--) {
   			e = gmap + y * COLS + win->x1;
   			for(x = win->x1; x <= win->x2; x++) {
-  			   _write(e->value, win->direct && doit,
+  			   _stdwrite(e->value, win->direct && doit,
   			   		x, y + 1, e->attr, e->color);
   			   e++;
   			}
@@ -917,7 +917,7 @@
   win->curx = ocurx;
 
   if (!doit) for(x = win->x1; x <= win->x2; x++)
-		_write(' ', 0, x, win->y1 + win->cury, win->attr, win->color);
+		_stdwrite(' ', 0, x, win->y1 + win->cury, win->attr, win->color);
   if (!_intern && win->direct)
   	_gotoxy(win->x1 + win->curx, win->y1 + win->cury);
   if (dirflush && !_intern && win->direct) wflush();
@@ -992,7 +992,7 @@
 		}
 		/* Now write the character. */
 		if (c != '\n') {
-			_write(c, win->direct, win->curx + win->x1,
+			_stdwrite(c, win->direct, win->curx + win->x1,
 				win->cury + win->y1, win->attr, win->color);
   			if (++win->curx >= win->xs && !win->wrap) {
 				win->curx--;	
@@ -1018,7 +1018,7 @@
 
   /* MARK updated 02/17/94 - Fixes bug, to do all 80 cols, not 79 cols */
   for(x = w->x1; x <= w->x2; x++) {
-	_write(e->value, w->direct, x,
+	_stdwrite(e->value, w->direct, x,
 		y + w->y1, e->attr, e->color);
 	e++;
   }
@@ -1107,10 +1107,10 @@
   if (pos == TMID) x = w->x1 + (w->xs - strlen(s)) / 2 - 1;
   if (x < w->x1) x = w->x1;
 
-  if (x < w->x2) _write('[', w->direct, x++, w->y1 - 1, w->attr, w->color);
-  while(*s && x <= w->x2) _write(*s++, w->direct, x++, w->y1 - 1,
+  if (x < w->x2) _stdwrite('[', w->direct, x++, w->y1 - 1, w->attr, w->color);
+  while(*s && x <= w->x2) _stdwrite(*s++, w->direct, x++, w->y1 - 1,
   		w->attr, w->color);
-  if (x <= w->x2) _write(']', w->direct, x++, w->y1 - 1, w->attr, w->color);
+  if (x <= w->x2) _stdwrite(']', w->direct, x++, w->y1 - 1, w->attr, w->color);
 
   if (w->direct) {
   	_gotoxy(w->x1 + w->curx, w->y1 + w->cury);
@@ -1148,10 +1148,10 @@
   		x = '>';
   	else
   		x = ' ';
-  	_write(x, w->direct, w->x1, y, attr, e->color);
+  	_stdwrite(x, w->direct, w->x1, y, attr, e->color);
   } else {
 	for(x = w->x1; x <= w->x2; x++) {
-  		_write(e->value, w->direct, x, y, attr, e->color);
+  		_stdwrite(e->value, w->direct, x, y, attr, e->color);
   		e++;
 	}
   }
@@ -1283,7 +1283,7 @@
   
   n = w->x1 + w->curx;
   if( n > w->x2) n = w->x2;
-  for(x = w->x1; x <= n; x++) _write(' ', w->direct, x, y,
+  for(x = w->x1; x <= n; x++) _stdwrite(' ', w->direct, x, y,
   		w->attr, w->color);
   if (w->direct) {
   	_gotoxy(n, y);
@@ -1498,7 +1498,7 @@
   /* Write buffer to screen */
   e = buf;
   for(++x; x <= w->x2; x++) {
-  	_write(e->value, doit && w->direct, x, y, e->attr, e->color);
+  	_stdwrite(e->value, doit && w->direct, x, y, e->attr, e->color);
   	e++;
   }
   w->direct = odir;
@@ -1538,10 +1538,10 @@
   e = gmap + y * COLS + x + 1;
   
   for(; x < w->x2; x++) {
-  	_write(e->value, doit && w->direct, x, y, e->attr, e->color);
+  	_stdwrite(e->value, doit && w->direct, x, y, e->attr, e->color);
   	e++;
   }
-  _write(' ', doit && w->direct, x, y, w->attr, w->color);
+  _stdwrite(' ', doit && w->direct, x, y, w->attr, w->color);
   wlocate(w, w->curx, w->cury);
 }
 
--- orig_source/windiv.c	Thu Mar 30 19:16:10 1995
+++ source/windiv.c	Sun Dec 10 00:56:48 1995
@@ -17,7 +17,7 @@
  * Popup a window and put a text in it.
  */  
 /*VARARGS1*/
-WIN *tell(s, a1, a2, a3, a4)
+WIN *wtell(s, a1, a2, a3, a4)
 char *s, *a1, *a2, *a3, *a4;
 {
   WIN *w;
@@ -46,7 +46,7 @@
 {
   WIN *tellwin;
   
-  tellwin = tell(s, a1, a2, a3, a4);
+  tellwin = wtell(s, a1, a2, a3, a4);
   sleep(2);
   wclose(tellwin, 1);
 }
--- orig_source/sysdep1.c	Wed Mar 15 18:42:26 1995
+++ source/sysdep1.c	Sun Dec 10 00:48:28 1995
@@ -49,7 +49,7 @@
 void m_setrts(fd)
 int fd;
 {
-#if defined(TIOCM_RTS) && defined(TIOCMODG)
+#if defined(TIOCM_RTS) && defined(TIOCMODG) && defined(TIOCMODS)
   int mcs;
 
   ioctl(fd, TIOCMODG, &mcs);
--- orig_source/minicom.h	Wed Mar 15 18:37:36 1995
+++ source/minicom.h	Sun Dec 10 01:00:36 1995
@@ -217,7 +217,7 @@
 /*      Prototypes from file: " windiv.c "      */
 
 /* Should use stdarg et al. */
-WIN *tell();
+WIN *wtell();
 void werror();
 _PROTO(int ask, ( char *what , char *s []));
 _PROTO(char *input, ( char *s , char *buf ));
--- orig_source/port.h	Thu May 25 12:07:20 1995
+++ source/port.h	Fri Dec 22 20:56:44 1995
@@ -97,7 +97,7 @@
 
 /* Availability of fchown(int, uid_t, gid_t) */
 #if defined (_SYSV) || defined (_BSD43) || defined(_DGUX_SOURCE)
-#  if !defined(_SVR2) && !defined(_SYSV3) && !defined(_COH42)
+#  if !defined(_SVR2) && !defined(_SYSV3) && !defined(_COH42) && !defined(_MINT)
 #    define HAS_FCHOWN
 #  endif
 #endif
--- orig_source/sysdep.h	Wed Feb  8 16:42:24 1995
+++ source/sysdep.h	Fri Dec 22 20:35:02 1995
@@ -26,7 +26,7 @@
 #ifdef _SCO
 #  define _IBCS2 /* So we get struct winsize :-) */
 #endif
-#if defined (_SYSV)
+#if defined (_SYSV) && !defined(_MINT)
 #  if !defined(_POSIX) || defined(_NO_TERMIOS)
 #    include <sys/termio.h>
 #  else
--- orig_source/Makefile	Thu May 25 13:18:30 1995
+++ source/Makefile	Sat Dec 23 22:09:14 1995
@@ -11,11 +11,16 @@
 #
 #
 
-# Where to install things for Linux sites (FSSTND)
-BINDIR	= /usr/bin
-LIBDIR	= /var/lib/minicom
+# Where to install things for MiNT sites (maybe... edit as you want)
+BINDIR	= /usr/local/bin
+LIBDIR	= /usr/local/lib
 MANDIR	= /usr/man/man1
 
+# Where to install things for Linux sites (FSSTND)
+#BINDIR	= /usr/bin
+#LIBDIR	= /var/lib/minicom
+#MANDIR	= /usr/man/man1
+
 # Where to install things for Linux/OWLD
 # BINDIR	= /usr/opt/bin
 # LIBDIR	= /conf/opt/minicom
@@ -26,15 +31,23 @@
 # LIBDIR	= /usr/local/lib
 # MANDIR	= /usr/local/man/man1
 
+# Take these compilation flags for MiNT.
+
+FLAGS	= -D_POSIX -D_SYSV -D_SELECT -D_HAVE_MACROS -D_MINT
+PROGS	= minicom runscript
+LFLAGS	= -s
+LIBS	= -ltermcap
+CC	= gcc
+
 # Take these compilation flags for Linux.
 # By some strange coincidence, the very same flags also
 # work for FreeBSD. Yes, even with the "-D_SYSV" flag.
 #
-FLAGS	= -Wall -D_POSIX -D_SYSV -D_SELECT -D_HAVE_MACROS	# Linux.
-PROGS	= minicom runscript
-LFLAGS	= -s
-LIBS	= -ltermcap
-CC	= cc
+#FLAGS	= -Wall -D_POSIX -D_SYSV -D_SELECT -D_HAVE_MACROS	# Linux.
+#PROGS	= minicom runscript
+#LFLAGS	= -s
+#LIBS	= -ltermcap
+#CC	= cc
 
 # Take these flags for SCO unix.
 #FLAGS	= -D_SYSV -D_SCO -D_POSIX -D_SELECT -D_HAVE_MACROS
