[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: machine specific patch (OpenBSD)
From: |
Paul Eggert |
Subject: |
Re: machine specific patch (OpenBSD) |
Date: |
Wed, 13 Jul 2011 16:00:41 -0700 |
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 |
On 07/13/11 08:22, Manuel Giraud wrote:
> Ok, so far I've updated those:
<http://www.openbsd.org/cgi-bin/cvsweb/ports/editors/emacs23/patches/>
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 <http
#include <config.h>
+#include <errno.h>
#include <stdio.h>
#include <setjmp.h>
@@ -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