Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/vte/ChangeLog,v
retrieving revision 1.283.2.35
diff -u -r1.283.2.35 ChangeLog
--- ChangeLog	4 Mar 2003 19:25:23 -0000	1.283.2.35
+++ ChangeLog	18 Mar 2003 09:21:06 -0000
@@ -1,3 +1,11 @@
+2003-03-18  Chris Toshok  <toshok@ximian.com>
+
+	* src/vte.c (vte_terminal_io_read): don't rely on the MAX to deal
+	properly with signed/unsigned comparisonss.  Sometimes bcount is
+	negative, and will be chosen by MAX when compared to the unsigned
+	sizeof(buf).  Fixes terminal hanging on FreeBSD (but really
+	shouldn't be unique to that OS.)
+
 2003-03-04 nalin
 	* src/vte.c(vte_terminal_insert_char): wrap properly when a scrolling
 	region is set (#107559).  From HEAD.
Index: src/vte.c
===================================================================
RCS file: /cvs/gnome/vte/src/vte.c,v
retrieving revision 1.284.2.20
diff -u -r1.284.2.20 vte.c
--- src/vte.c	4 Mar 2003 19:25:26 -0000	1.284.2.20
+++ src/vte.c	18 Mar 2003 09:21:09 -0000
@@ -7320,6 +7320,7 @@
 	if (condition & G_IO_IN) {
 		bcount = sizeof(buf) -
 			 _vte_buffer_length(terminal->pvt->incoming);
+		if (bcount < 0) bcount = 0;
 		bcount = read(fd, buf, MAX(bcount, sizeof(buf) / 2));
 	}
 	eof = FALSE;
