From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: machine specific patch (OpenBSD) Date: Wed, 13 Jul 2011 16:00:41 -0700 Organization: UCLA Computer Science Department Message-ID: <4E1E2399.50506@cs.ucla.edu> References: <871uxucls5.fsf@univ-nantes.fr> <87wrfmb3ye.fsf@univ-nantes.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1310598093 12577 80.91.229.12 (13 Jul 2011 23:01:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 23:01:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Manuel Giraud Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 14 01:01:28 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qh8Qp-000232-Rp for ged-emacs-devel@m.gmane.org; Thu, 14 Jul 2011 01:01:28 +0200 Original-Received: from localhost ([::1]:58864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh8Qo-0002Cm-Si for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2011 19:01:26 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh8QP-0002Be-Jh for emacs-devel@gnu.org; Wed, 13 Jul 2011 19:01:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qh8QL-0000hN-IP for emacs-devel@gnu.org; Wed, 13 Jul 2011 19:01:01 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:59177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh8QK-0000gQ-TP for emacs-devel@gnu.org; Wed, 13 Jul 2011 19:00:57 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id E538539E80F2; Wed, 13 Jul 2011 16:00:46 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2NaRK-3P+pjU; Wed, 13 Jul 2011 16:00:42 -0700 (PDT) Original-Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 5C05139E80F0; Wed, 13 Jul 2011 16:00:42 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Thunderbird/3.1.11 In-Reply-To: <87wrfmb3ye.fsf@univ-nantes.fr> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142015 Archived-At: On 07/13/11 08:22, Manuel Giraud wrote: > Ok, so far I've updated those: doesn't seem to be updated; it was last changed 3 months ago. Are the updated patches available anywhere other than in your email? > I didn't include others because they are related to mips64 and alpha > arch and i cannot test it. Has anyone tested them? The two mips64 files seem long enough that they'll require copyright assignment papers. Did you write them? If not, who? >> +#define BROKEN_SIGIO Could you please explain why that's needed? Is there some discussion of this somewhere? It'd be helpful to have that in a comment somewhere. Regarding the minibuf.c patch: Is a similar patch (for fgets) needed in xfaces.c's Fx_load_color_file function, for the case where Emacs is configured without HAVE_X_WINDOWS? The minibuf.c patch is a bit confusing, with gotos and suchlike. Does the following patch fix the problem as well? It's a longer patch, but the resulting code should be more straightforward. === modified file 'src/minibuf.c' --- src/minibuf.c 2011-06-24 21:25:22 +0000 +++ src/minibuf.c 2011-07-13 22:52:27 +0000 @@ -19,6 +19,7 @@ along with GNU Emacs. If not, see +#include #include #include @@ -236,8 +237,9 @@ read_minibuf_noninteractive (Lisp_Object int allow_props, int inherit_input_method) { ptrdiff_t size, len; - char *line, *s; + char *line; Lisp_Object val; + int c; fprintf (stdout, "%s", SDATA (prompt)); fflush (stdout); @@ -246,22 +248,30 @@ read_minibuf_noninteractive (Lisp_Object size = 100; len = 0; line = (char *) xmalloc (size); - while ((s = fgets (line + len, size - len, stdin)) != NULL - && (len = strlen (line), - len == size - 1 && line[len - 1] != '\n')) + + while ((c = getchar ()) != '\n') { - if (STRING_BYTES_BOUND / 2 < size) - memory_full (SIZE_MAX); - size *= 2; - line = (char *) xrealloc (line, size); + if (c < 0) + { + if (errno != EINTR) + break; + } + else + { + if (len == size) + { + if (STRING_BYTES_BOUND / 2 < size) + memory_full (SIZE_MAX); + size *= 2; + line = (char *) xrealloc (line, size); + } + line[len++] = c; + } } - if (s) + if (len) { - char *nl = strchr (line, '\n'); - if (nl) - *nl = '\0'; - val = build_string (line); + val = make_string (line, len); xfree (line); } else