aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-07-19 13:37:27 -0700
committerPaul Eggert2011-07-19 13:37:27 -0700
commit63cf7836ae7616ce91d7eeaeac997d71609e191b (patch)
tree801b7c438808303fd47cf19aec1d899c78c2472f /src
parent7403ff044d82d390bdc4cdd3954448daedcd4571 (diff)
parent0d8de0fd0a5a63cc9558b5c99f9c7f1ddcaf338a (diff)
downloademacs-63cf7836ae7616ce91d7eeaeac997d71609e191b.tar.gz
emacs-63cf7836ae7616ce91d7eeaeac997d71609e191b.zip
Merge from intsign.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog20
-rw-r--r--src/lread.c7
-rw-r--r--src/minibuf.c36
-rw-r--r--src/s/openbsd.h6
-rw-r--r--src/unexelf.c4
5 files changed, 53 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f7f68b41838..30af92a57e9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -106,6 +106,8 @@
106 (gs_load): Use printmax_t to print the widest integers possible. 106 (gs_load): Use printmax_t to print the widest integers possible.
107 Check for integer overflow when computing image height and width. 107 Check for integer overflow when computing image height and width.
108 108
1092011-07-19 Paul Eggert <eggert@cs.ucla.edu>
110
109 Integer signedness and overflow and related fixes. (Bug#9079) 111 Integer signedness and overflow and related fixes. (Bug#9079)
110 112
111 * bidi.c: Integer size and overflow fixes. 113 * bidi.c: Integer size and overflow fixes.
@@ -303,6 +305,24 @@
303 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally 305 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
304 well either way, and we prefer signed to unsigned. 306 well either way, and we prefer signed to unsigned.
305 307
3082011-07-19 Paul Eggert <eggert@cs.ucla.edu>
309
310 Port to OpenBSD.
311 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
312 and the surrounding thread.
313 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
314 rather than fgets, and retry after EINTR. Otherwise, 'emacs
315 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
316 timer goes off.
317 * s/openbsd.h (BROKEN_SIGIO): Define.
318 * unexelf.c (unexec) [__OpenBSD__]:
319 Don't update the .mdebug section of the Alpha COFF symbol table.
320
3212011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
322
323 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
324 (bug#8460).
325
3062011-07-18 Paul Eggert <eggert@cs.ucla.edu> 3262011-07-18 Paul Eggert <eggert@cs.ucla.edu>
307 327
308 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask. 328 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
diff --git a/src/lread.c b/src/lread.c
index c0de95dd121..0613ad037bf 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4491,10 +4491,9 @@ to load. See also `load-dangerous-libraries'. */);
4491 Qlexical_binding = intern ("lexical-binding"); 4491 Qlexical_binding = intern ("lexical-binding");
4492 staticpro (&Qlexical_binding); 4492 staticpro (&Qlexical_binding);
4493 DEFVAR_LISP ("lexical-binding", Vlexical_binding, 4493 DEFVAR_LISP ("lexical-binding", Vlexical_binding,
4494 doc: /* If non-nil, use lexical binding when evaluating code. 4494 doc: /* Whether to use lexical binding when evaluating code.
4495This applies to code evaluated by `eval-buffer' and `eval-region' and 4495Non-nil means that the code in the current buffer should be evaluated
4496other commands that call these functions, like `eval-defun' and 4496with lexical binding.
4497the like.
4498This variable is automatically set from the file variables of an 4497This variable is automatically set from the file variables of an
4499interpreted Lisp file read using `load'. */); 4498interpreted Lisp file read using `load'. */);
4500 Fmake_variable_buffer_local (Qlexical_binding); 4499 Fmake_variable_buffer_local (Qlexical_binding);
diff --git a/src/minibuf.c b/src/minibuf.c
index 951bf028c38..eb564a10ec6 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -19,6 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20 20
21#include <config.h> 21#include <config.h>
22#include <errno.h>
22#include <stdio.h> 23#include <stdio.h>
23#include <setjmp.h> 24#include <setjmp.h>
24 25
@@ -236,8 +237,9 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
236 int allow_props, int inherit_input_method) 237 int allow_props, int inherit_input_method)
237{ 238{
238 ptrdiff_t size, len; 239 ptrdiff_t size, len;
239 char *line, *s; 240 char *line;
240 Lisp_Object val; 241 Lisp_Object val;
242 int c;
241 243
242 fprintf (stdout, "%s", SDATA (prompt)); 244 fprintf (stdout, "%s", SDATA (prompt));
243 fflush (stdout); 245 fflush (stdout);
@@ -246,22 +248,30 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
246 size = 100; 248 size = 100;
247 len = 0; 249 len = 0;
248 line = (char *) xmalloc (size); 250 line = (char *) xmalloc (size);
249 while ((s = fgets (line + len, size - len, stdin)) != NULL 251
250 && (len = strlen (line), 252 while ((c = getchar ()) != '\n')
251 len == size - 1 && line[len - 1] != '\n'))
252 { 253 {
253 if (STRING_BYTES_BOUND / 2 < size) 254 if (c < 0)
254 memory_full (SIZE_MAX); 255 {
255 size *= 2; 256 if (errno != EINTR)
256 line = (char *) xrealloc (line, size); 257 break;
258 }
259 else
260 {
261 if (len == size)
262 {
263 if (STRING_BYTES_BOUND / 2 < size)
264 memory_full (SIZE_MAX);
265 size *= 2;
266 line = (char *) xrealloc (line, size);
267 }
268 line[len++] = c;
269 }
257 } 270 }
258 271
259 if (s) 272 if (len)
260 { 273 {
261 char *nl = strchr (line, '\n'); 274 val = make_string (line, len);
262 if (nl)
263 *nl = '\0';
264 val = build_string (line);
265 xfree (line); 275 xfree (line);
266 } 276 }
267 else 277 else
diff --git a/src/s/openbsd.h b/src/s/openbsd.h
index 175d61dc9c9..0a8bab2290f 100644
--- a/src/s/openbsd.h
+++ b/src/s/openbsd.h
@@ -1,5 +1,9 @@
1/* System file for openbsd. */ 1/* System file for openbsd. */
2 2
3/* The same as NetBSD. Note there are differences in configure. */ 3/* Nearly the same as NetBSD. Note there are differences in configure. */
4#include "netbsd.h" 4#include "netbsd.h"
5 5
6/* The symbol SIGIO is defined, but the feature doesn't work in the
7 way Emacs needs it to. See
8 <http://article.gmane.org/gmane.os.openbsd.ports/46831>. */
9#define BROKEN_SIGIO
diff --git a/src/unexelf.c b/src/unexelf.c
index 951e7c0eea6..a169ffcb5c8 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -1053,7 +1053,7 @@ temacs:
1053 memcpy (NEW_SECTION_H (nn).sh_offset + new_base, src, 1053 memcpy (NEW_SECTION_H (nn).sh_offset + new_base, src,
1054 NEW_SECTION_H (nn).sh_size); 1054 NEW_SECTION_H (nn).sh_size);
1055 1055
1056#ifdef __alpha__ 1056#if defined __alpha__ && !defined __OpenBSD__
1057 /* Update Alpha COFF symbol table: */ 1057 /* Update Alpha COFF symbol table: */
1058 if (strcmp (old_section_names + OLD_SECTION_H (n).sh_name, ".mdebug") 1058 if (strcmp (old_section_names + OLD_SECTION_H (n).sh_name, ".mdebug")
1059 == 0) 1059 == 0)
@@ -1072,7 +1072,7 @@ temacs:
1072 symhdr->cbRfdOffset += new_data2_size; 1072 symhdr->cbRfdOffset += new_data2_size;
1073 symhdr->cbExtOffset += new_data2_size; 1073 symhdr->cbExtOffset += new_data2_size;
1074 } 1074 }
1075#endif /* __alpha__ */ 1075#endif /* __alpha__ && !__OpenBSD__ */
1076 1076
1077#if defined (_SYSTYPE_SYSV) 1077#if defined (_SYSTYPE_SYSV)
1078 if (NEW_SECTION_H (nn).sh_type == SHT_MIPS_DEBUG 1078 if (NEW_SECTION_H (nn).sh_type == SHT_MIPS_DEBUG