changeset 22042:31e8f7100c12

(Finsert_file_contents): Don't use the fast replace code if coding needs eol conversion. (Finsert_file_contents) [DOS_NT]: When setting buffer_file_type, if code conversion is needed, file is not binary.
author Richard M. Stallman <rms@gnu.org>
date Tue, 12 May 1998 23:10:15 +0000
parents e977f2414da5
children 10a9f355a346
files src/fileio.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Tue May 12 23:09:35 1998 +0000
+++ b/src/fileio.c	Tue May 12 23:10:15 1998 +0000
@@ -3453,7 +3453,9 @@
      But if we discover the need for conversion, we give up on this method
      and let the following if-statement handle the replace job.  */
   if (!NILP (replace)
-      && ! CODING_REQUIRE_DECODING (&coding))
+      && ! CODING_REQUIRE_DECODING (&coding)
+      && (coding.eol_type == CODING_EOL_UNDECIDED
+	  || coding.eol_type == CODING_EOL_LF))
     {
       /* same_at_start and same_at_end count bytes,
 	 because file access counts bytes
@@ -3912,11 +3914,12 @@
       /* Use the conversion type to determine buffer-file-type
 	 (find-buffer-file-type is now used to help determine the
 	 conversion).  */
-      if (coding.eol_type != CODING_EOL_UNDECIDED 
-	  && coding.eol_type != CODING_EOL_LF)
+      if ((coding.eol_type == CODING_EOL_UNDECIDED 
+	   || coding.eol_type == CODING_EOL_LF)
+	  && ! CODING_REQUIRE_DECODING (&coding))
+	current_buffer->buffer_file_type = Qt;
+      else
 	current_buffer->buffer_file_type = Qnil;
-      else
-	current_buffer->buffer_file_type = Qt;
 #endif
     }