From xemacs-m  Wed Mar  5 15:54:43 1997
Received: from corona.pixar.com (corona.pixar.com [138.72.20.84])
	by xemacs.org (8.8.5/8.8.5) with SMTP id PAA14354
	for <xemacs-beta@xemacs.org>; Wed, 5 Mar 1997 15:54:39 -0600 (CST)
Received: by corona.pixar.com (Smail3.1.29.1 #2)
	id m0w2OcA-00016bC; Wed, 5 Mar 97 13:52 PST
Sender: retnuh@pixar.com (Hunter Kelly)
Sender: retnuh@corona
To: xemacs-beta@xemacs.org
Subject: additional gnuattach patch
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: multipart/mixed;
 boundary="Multipart_Wed_Mar__5_13:52:45_1997-1"
Content-Transfer-Encoding: 7bit
From: Hunter Kelly <retnuh@corona.pixar.com>
Date: 05 Mar 1997 13:52:45 -0800
Message-ID: <yvtwwrmqa4y.fsf@corona.pixar.com>
Lines: 52

--Multipart_Wed_Mar__5_13:52:45_1997-1
Content-Type: text/plain; charset=US-ASCII

Turns out that my patch didn't work right on Solaris.
Here is an additional patch that (from what Damon tells me) fixes the
problem.  Also, from a discussion I had just the other day with a
friend, is more portable.

Hunter


--Multipart_Wed_Mar__5_13:52:45_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="gpatch2"
Content-Transfer-Encoding: 8bit

--- gnuslib.c.patch1    Wed Mar  5 10:17:58 1997
+++ gnuslib.c   Wed Mar  5 10:15:45 1997
@@ -226,22 +226,17 @@
      char *dest;
 {
   char *index = NULL;
-  int length = 0;
-  int difference;
+  int length;
+  int offset=0;
   char buffer[GSERV_BUFSZ+1];
 
-  do {
-    if ((length = recv(s,buffer,GSERV_BUFSZ, MSG_PEEK)) > 0)
-      buffer[length] = '\0';
-    else
-      return 0;
-  } while ((index = strchr(buffer, '\n')) == NULL);
-
-  difference = (int)(index - buffer);
-  length = read(s,buffer,difference);
-  if (length == 0)
-    return 0;
-  buffer[length] = '\0';
+  while ((length=read(s,buffer+offset,1)) && buffer[offset]!='\n'
+        && buffer[offset] != EOT_CHR) {
+    offset += length;
+    if (offset >= GSERV_BUFSZ) 
+      break;
+  }
+  buffer[offset] = '\0';
   strcpy(dest,buffer);
   return 1;
 } /* read_line */

--Multipart_Wed_Mar__5_13:52:45_1997-1--

