diff src/database.c @ 4351:bc3b9f61018e

Respect the CODESYS argument in #'open-database; don't autodetect EOL. 2007-12-22 Aidan Kehoe <kehoea@parhasard.net> * database.c (Fopen_database): Actually respect the CODESYS argument; don't require EOL autodetection from the coding system, because autodetection mostly fails with reads of small amounts of data. It might be possible with an implicit #'map-database on open, though I don't think that's a great idea. * database.c (print_database): Give the coding system used for text conversion when printing a database object.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 22 Dec 2007 15:02:04 +0100
parents 9a633a00c3f2
children 0e1461b592ce
line wrap: on
line diff
--- a/src/database.c	Sat Dec 22 02:14:23 2007 -0800
+++ b/src/database.c	Sat Dec 22 15:02:04 2007 +0100
@@ -31,6 +31,7 @@
 
 #include "sysfile.h"
 #include "buffer.h"
+#include "file-coding.h"
 
 #ifndef HAVE_DATABASE
 #error HAVE_DATABASE not defined!!
@@ -181,11 +182,16 @@
 			 3, db->fname, db->funcs->get_type (db),
 			 db->funcs->get_subtype (db));
 
-  write_fmt_string (printcharfun, "%s) 0x%x>",
+  write_fmt_string (printcharfun, "%s) ",
 		    (!DATABASE_LIVE_P (db)    ? "closed"    :
 		     (db->access_ & O_WRONLY) ? "writeonly" :
-		     (db->access_ & O_RDWR)   ? "readwrite" : "readonly"),
-		    db->header.uid);
+		     (db->access_ & O_RDWR)   ? "readwrite" : "readonly"));
+
+  write_fmt_string_lisp (printcharfun, "coding: %s ", 1,
+                         XSYMBOL_NAME (XCODING_SYSTEM_NAME
+                                       (db->coding_system)));
+
+  write_fmt_string (printcharfun, "0x%x>", db->header.uid);
 }
 
 static void
@@ -654,7 +660,7 @@
   if (NILP (codesys))
     codesys = Vdatabase_coding_system;
 
-  codesys = get_coding_system_for_text_file (Vdatabase_coding_system, 1);
+  codesys = get_coding_system_for_text_file (codesys, 0);
 
 #ifdef HAVE_DBM
   if (NILP (type) || EQ (type, Qdbm))