# HG changeset patch # User Aidan Kehoe # Date 1198332124 -3600 # Node ID bc3b9f61018efe778ecbbab927c5d8f37b60a629 # Parent 50889296c05cd0f9ea1295d66479ea49fb3ead8e Respect the CODESYS argument in #'open-database; don't autodetect EOL. 2007-12-22 Aidan Kehoe * 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. diff -r 50889296c05c -r bc3b9f61018e src/ChangeLog --- a/src/ChangeLog Sat Dec 22 02:14:23 2007 -0800 +++ b/src/ChangeLog Sat Dec 22 15:02:04 2007 +0100 @@ -1,3 +1,15 @@ +2007-12-22 Aidan Kehoe + + * 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. + 2007-12-20 Jerry James * sound.c: Fix unused parameter warnings when HAVE_ALSA_SOUND. diff -r 50889296c05c -r bc3b9f61018e src/database.c --- 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))