diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-14 13:16:48 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-14 13:16:48 -0700 |
commit | 8bd7b8304a41da5dc0c8a11967c1a6005e9465d0 (patch) | |
tree | 145588110166df723c31f3fceaa00c190b77aa8c /src/fileio.c | |
parent | cd64ea1d0df393beb93d1bdf19bd3990e3378f85 (diff) | |
parent | 9024ff7943e9529ec38a80aaaa0db43224c1e885 (diff) | |
download | emacs-8bd7b8304a41da5dc0c8a11967c1a6005e9465d0.tar.gz emacs-8bd7b8304a41da5dc0c8a11967c1a6005e9465d0.tar.bz2 emacs-8bd7b8304a41da5dc0c8a11967c1a6005e9465d0.zip |
Merge from mainline.
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/fileio.c b/src/fileio.c index 7f749536d56..b8c5e796db4 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -146,8 +146,10 @@ static Lisp_Object Qcar_less_than_car; static Lisp_Object Fmake_symbolic_link (Lisp_Object, Lisp_Object, Lisp_Object); static int a_write (int, Lisp_Object, int, int, +static int a_write (int, Lisp_Object, EMACS_INT, EMACS_INT, Lisp_Object *, struct coding_system *); -static int e_write (int, Lisp_Object, int, int, struct coding_system *); +static int e_write (int, Lisp_Object, EMACS_INT, EMACS_INT, + struct coding_system *); void @@ -1808,7 +1810,8 @@ If PRESERVE-SELINUX-CONTEXT is non-nil and SELinux is enabled on the system, we copy the SELinux context of FILE to NEWNAME. */) (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists, Lisp_Object keep_time, Lisp_Object preserve_uid_gid, Lisp_Object preserve_selinux_context) { - int ifd, ofd, n; + int ifd, ofd; + EMACS_INT n; char buf[16 * 1024]; struct stat st, out_st; Lisp_Object handler; @@ -3802,9 +3805,7 @@ variable `last-coding-system-used' to the coding system actually used. */) /* For a special file, all we can do is guess. */ total = READ_BUF_SIZE; - /* FIXME: This if-statement is a no-op, because 'inserted' must be zero here - (Bug#8496). */ - if (NILP (visit) && inserted > 0) + if (NILP (visit) && total > 0) { #ifdef CLASH_DETECTION if (!NILP (BVAR (current_buffer, file_truename)) @@ -3914,7 +3915,6 @@ variable `last-coding-system-used' to the coding system actually used. */) if (inserted == 0) { #ifdef CLASH_DETECTION - /* FIXME: This code is a no-op, too (Bug#8496). */ if (we_locked_file) unlock_file (BVAR (current_buffer, file_truename)); #endif @@ -4799,11 +4799,13 @@ build_annotations (Lisp_Object start, Lisp_Object end) The return value is negative in case of system call failure. */ static int -a_write (int desc, Lisp_Object string, int pos, register int nchars, Lisp_Object *annot, struct coding_system *coding) +a_write (int desc, Lisp_Object string, EMACS_INT pos, + register EMACS_INT nchars, Lisp_Object *annot, + struct coding_system *coding) { Lisp_Object tem; - int nextpos; - int lastpos = pos + nchars; + EMACS_INT nextpos; + EMACS_INT lastpos = pos + nchars; while (NILP (*annot) || CONSP (*annot)) { @@ -4843,7 +4845,8 @@ a_write (int desc, Lisp_Object string, int pos, register int nchars, Lisp_Object are indexes to the string STRING. */ static int -e_write (int desc, Lisp_Object string, int start, int end, struct coding_system *coding) +e_write (int desc, Lisp_Object string, EMACS_INT start, EMACS_INT end, + struct coding_system *coding) { if (STRINGP (string)) { @@ -4874,8 +4877,8 @@ e_write (int desc, Lisp_Object string, int start, int end, struct coding_system } else { - int start_byte = CHAR_TO_BYTE (start); - int end_byte = CHAR_TO_BYTE (end); + EMACS_INT start_byte = CHAR_TO_BYTE (start); + EMACS_INT end_byte = CHAR_TO_BYTE (end); coding->src_multibyte = (end - start) < (end_byte - start_byte); if (CODING_REQUIRE_ENCODING (coding)) |