1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-19 06:31:34 -08:00
Commit graph

31526 commits

Author SHA1 Message Date
Chong Yidong
029529ac6f Fix handling of pending signals in wait_reading_process_output (Bug#8869).
* process.c (wait_reading_process_output): Bypass select if
waiting for a cell while ignoring keyboard input, and input is
pending.  Suggested by Jan Djärv.
2011-06-25 23:40:40 -04:00
Glenn Morris
5b66d427c0 ChangeLog fix. 2011-06-25 13:53:24 -07:00
Paul Eggert
948b98fd3c Merge from trunk. 2011-06-25 11:31:36 -07:00
Glenn Morris
11fdef7d0c Merge from emacs-23; up to 2010-06-15T03:34:12Z!rgm@gnu.org. 2011-06-25 11:21:00 -07:00
Paul Eggert
7a7ef42918 Use gnulib's dup2 module instead of rolling our own.
* Makefile.in (GNULIB_MODULES): Add dup2.
* configure.in: Do not check for dup2; gnulib does that now.
* lib/dup2.c, m4/dup2.m4: New files, from gnulib.
* src/sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
2011-06-25 01:40:38 -07:00
Juanma Barranquero
cd3520a41d Move DEFSYM to lisp.h and use everywhere. 2011-06-24 23:25:22 +02:00
Ted Zlatanov
4228cf16fb * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h. 2011-06-24 05:29:19 -05:00
Paul Eggert
7efb4e0e62 Merge from trunk. 2011-06-23 00:37:31 -07:00
Paul Eggert
ff5844ad0b * print.c (printchar, strout): Check for string overflow.
(PRINTPREPARE, printchar, strout):
Don't set size unless allocation succeeds.
2011-06-23 00:33:28 -07:00
Paul Eggert
90532f02fd * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
for sizes.  Check for string overflow more accurately.
Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
2011-06-22 23:45:38 -07:00
Paul Eggert
6d84508d18 * macros.c: Integer and buffer overflow fixes.
* keyboard.h (struct keyboard.kbd_macro_bufsize):
* macros.c (Fstart_kbd_macro, store_kbd_macro_char):
Use ptrdiff_t, not int, for sizes.
Don't increment bufsize until after realloc succeeds.
Check for size-calculation overflow.
(Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
2011-06-22 23:31:41 -07:00
Paul Eggert
20270765be * lread.c (read1): Check for size overflow. 2011-06-22 22:41:40 -07:00
Paul Eggert
437b2cb453 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling. 2011-06-22 22:35:51 -07:00
Paul Eggert
82cb60d3ff * lread.c (read_escape): Avoid int overflow.
(Fload, openp, read_buffer_size, read1)
(substitute_object_recurse, read_vector, read_list, map_obarray):
Use ptrdiff_t, not int, for sizes.
(read1): Use EMACS_INT, not int, for sizes.
2011-06-22 22:34:52 -07:00
Leo Liu
4e3232657c Move completing-read-function and completing-read-default to elisp 2011-06-23 11:35:05 +08:00
Paul Eggert
8b9ac8b4a2 * lread.c: Integer overflow fixes.
(read_integer): Radix is now EMACS_INT, not int,
to improve quality of diagnostics for out-of-range radices.
Calculate buffer size correctly for out-of-range radices.
(read1): Check for integer overflow in radices, and in
read-circle numbers.
2011-06-22 17:55:55 -07:00
Paul Eggert
7fcccf1efe * image.c (cache_image): Check for size arithmetic overflow. 2011-06-22 17:46:41 -07:00
Paul Eggert
39019e5425 * lread.c (read_escape): Check for hex character overflow. 2011-06-22 15:39:06 -07:00
Paul Eggert
bfbbd7e752 * lread.c: Integer overflow issues.
(saved_doc_string_size, saved_doc_string_length)
(prev_saved_doc_string_size, prev_saved_doc_string_length):
Now ptrdiff_t, not int.
(read1): Don't assume doc string length fits in int.  Check for
out-of-range doc string lengths.
(read_list): Don't assume file position fits in int.
2011-06-22 15:36:19 -07:00
Paul Eggert
20b84ce991 Merge: Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking. 2011-06-22 11:20:15 -07:00
Paul Eggert
85fece3ec2 GLYPH_DEBUG fixes
The following patches are for when GLYPH_DEBUG && !XASSERT.
* dispextern.h (trace_redisplay_p, dump_glyph_string):
* dispnew.c (flush_stdout):
* xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
Mark as externally visible.
* dispnew.c (check_window_matrix_pointers): Now static.
* dispnew.c (window_to_frame_vpos):
* xfns.c (unwind_create_frame):
* xterm.c (x_check_font): Remove unused local.
* scroll.c (CHECK_BOUNDS):
* xfaces.c (cache_fache): Rename local to avoid shadowing.
* xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
* xdisp.c (check_window_end): Now a no-op if !XASSERTS.
(debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
(debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
Now static.
(debug_method_add): Use va_list and vsprintf rather than relying
on undefined behavior with wrong number of arguments.
(dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
Don't assume ptrdiff_t and EMACS_INT are the same width as int.
In this code, it's OK to assume C99 behavior for ptrdiff_t formats
since we're not interested in debugging glyphs with old libraries.
* xfaces.c (cache_face): Move debugging code earlier; this pacifies
GCC 4.6.0's static checking.
2011-06-22 11:15:23 -07:00
Paul Eggert
31fd4b3280 Merge: Integer overflow and signedness fixes (Bug#8873).
A few related buffer overrun fixes, too.
2011-06-22 09:15:41 -07:00
Paul Eggert
510005210a Merge from trunk. 2011-06-22 09:01:00 -07:00
Jim Meyering
d5a19415d0 don't leak an XBM-image-sized buffer
* image.c (xbm_load): Free the image buffer after using it.
2011-06-22 14:23:17 +02:00
Paul Eggert
b79e8648b9 * font.c (font_score): Use EMACS_INT, not int, to store XINT value. 2011-06-21 23:18:06 -07:00
Paul Eggert
0766b489e1 * dispextern.h (struct face.stipple):
* image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
(x_bitmap_mask, x_allocate_bitmap_record)
(x_create_bitmap_from_data, x_create_bitmap_from_file)
(x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
(x_create_bitmap_from_xpm_data):
* nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
* w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
(.bitmaps_last):
* xfaces.c (load_pixmap):
* xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
* xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
(.bitmaps_last, struct x_output.icon_bitmap):
Use ptrdiff_t, not int, for bitmap indexes.
(x_allocate_bitmap_record): Check for size overflow.
* dispextern.h, lisp.h: Adjust to API changes elsewhere.
2011-06-21 23:16:16 -07:00
Paul Eggert
21514da7b2 * buffer.c (OVERLAY_COUNT_MAX): New macro.
(overlays_in, mouse_face_overlay_overlaps, Foverlays_in):
Use ptrdiff_t, not int, for sizes.
(overlays_in): Check for size-calculation overflow.
2011-06-21 16:16:43 -07:00
Paul Eggert
b081724f64 Use ptrdiff_t, not int, for overlay counts.
* buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
* editfns.c (overlays_around, get_pos_property):
* textprop.c (get_char_property_and_overlay):
* xdisp.c (next_overlay_change, note_mouse_highlight):
* xfaces.c (face_at_buffer_position):
* buffer.c (overlays_at, sort_overlays, Foverlays_at)
(Fnext_overlay_change, Fprevious_overlay_change):
Use ptrdiff_t, not int, for sizes.
(overlays_at): Check for size-calculation overflow.
2011-06-21 14:32:10 -07:00
Paul Eggert
3de73e5ee5 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int. 2011-06-21 13:43:08 -07:00
Paul Eggert
2606c57bbf * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
(x_session_initialize): Do not assume string length fits in int.
2011-06-21 13:32:19 -07:00
Paul Eggert
2674ddc8af * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font): Avoid need for strlen. 2011-06-21 10:52:14 -07:00
Paul Eggert
aaafe47af1 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
This is unlikely, but can occur if DPI is outlandish.
2011-06-21 10:49:46 -07:00
Paul Eggert
a9041e6caf Port to Sun C.
* composite.c (find_automatic_composition): Omit needless 'return 0;'
that Sun C diagnosed.
* fns.c (secure_hash): Fix pointer signedness issue.
* intervals.c (static_offset_intervals): New function.
(offset_intervals): Use it.
2011-06-21 09:47:56 -07:00
Leo Liu
7f3f739fa4 New primitive secure-hash supporting md5, sha-1 and sha-2 2011-06-21 16:55:22 +08:00
Paul Eggert
da3f12b238 * font.c (font_intern_prop): Don't use string_to_number, since the string isn't null-terminated. 2011-06-20 23:47:52 -07:00
Paul Eggert
3a5077c52b * xselect.c (Fx_get_atom_name): Avoid need for strlen. 2011-06-20 19:16:54 -07:00
Paul Eggert
281549626c * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
* xrdb.c (magic_file_p, search_magic_path):
Omit last arg SUFFIX; it was always 0.  All callers changed.
(magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
2011-06-20 19:15:16 -07:00
Paul Eggert
7de51af53b * xfont.c (xfont_match): Avoid need for strlen. 2011-06-20 18:40:45 -07:00
Paul Eggert
25ed6cc397 * xfns.c: Don't assume strlen fits in int.
(xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
2011-06-20 18:38:04 -07:00
Paul Eggert
df1f27af9e * xdisp.c (display_mode_element): Don't assume strlen fits in int. 2011-06-20 18:30:32 -07:00
Paul Eggert
4eab31dd61 * xdisp.c (message_log_check_duplicate): Return intmax_t,
not unsigned long, as we prefer signed integers.  All callers changed.
Detect integer overflow in repeat count.
(message_dolog): Don't assume print length fits in 39 bytes.
2011-06-20 18:21:44 -07:00
Paul Eggert
25c7e41fc6 * callproc.c (egetenv): Adjust to getenv_internal API change. 2011-06-20 18:06:45 -07:00
Paul Eggert
51cab52b05 Merge from trunk. 2011-06-20 17:59:02 -07:00
Deniz Dogan
76147d94eb * src/process.c (Fset_process_buffer): Clarify return value in docstring. 2011-06-20 14:54:05 +02:00
Paul Eggert
171e2a582e * termcap.c: Don't assume sizes fit in int and never overflow.
(struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
(gobble_line): Check for size-calculation overflow.
2011-06-20 00:21:06 -07:00
Paul Eggert
ad39facaee * minibuf.c (Fread_buffer): Don't assume strlen fits in int. 2011-06-19 23:14:57 -07:00
Paul Eggert
6e5bb2dc82 * lread.c (intern, intern_c_string): Don't assume strlen fits in int. 2011-06-19 23:11:36 -07:00
Paul Eggert
52c61c22ee * keyboard.c (parse_tool_bar_item): Avoid need for strlen. 2011-06-19 23:07:16 -07:00
Paul Eggert
74ca2eb34b * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
Don't assume string length fits in int.
2011-06-19 23:03:10 -07:00
Paul Eggert
9bda3520ff * gtkutil.c (style_changed_cb): Avoid need for strlen. 2011-06-19 22:54:33 -07:00