From: Paul Eggert <eggert@cs.ucla.edu>
To: Manuel Giraud <manuel.giraud@univ-nantes.fr>
Cc: emacs-devel@gnu.org
Subject: Re: machine specific patch (OpenBSD)
Date: Wed, 13 Jul 2011 16:00:41 -0700 [thread overview]
Message-ID: <4E1E2399.50506@cs.ucla.edu> (raw)
In-Reply-To: <87wrfmb3ye.fsf@univ-nantes.fr>
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
next prev parent reply other threads:[~2011-07-13 23:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-13 14:12 machine specific patch (OpenBSD) Manuel Giraud
2011-07-13 14:40 ` Dan Nicolaescu
2011-07-13 15:22 ` Manuel Giraud
2011-07-13 23:00 ` Paul Eggert [this message]
2011-07-19 9:52 ` Manuel Giraud
2011-07-19 17:44 ` Paul Eggert
2011-07-20 11:31 ` Manuel Giraud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E1E2399.50506@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=manuel.giraud@univ-nantes.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).