mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-01-02 12:27:09 +08:00
[API break] Make date/boolean formats thread safe
Store the preferred date and boolean formats in the MdbHandle rather than in global memory.
This commit is contained in:
@@ -159,17 +159,11 @@ main(int argc, char **argv)
|
||||
if (insert_dialect)
|
||||
header_row = 0;
|
||||
|
||||
if (date_fmt)
|
||||
mdb_set_date_fmt(date_fmt);
|
||||
|
||||
if (null_text)
|
||||
null_text = escapes(null_text);
|
||||
else
|
||||
null_text = g_strdup("");
|
||||
|
||||
if (boolean_words)
|
||||
mdb_set_boolean_fmt_words();
|
||||
|
||||
if (str_bin_mode) {
|
||||
if (!strcmp(str_bin_mode, "strip"))
|
||||
bin_mode = MDB_BINEXPORT_STRIP;
|
||||
@@ -189,6 +183,12 @@ main(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (date_fmt)
|
||||
mdb_set_date_fmt(mdb, date_fmt);
|
||||
|
||||
if (boolean_words)
|
||||
mdb_set_boolean_fmt_words(mdb);
|
||||
|
||||
if (insert_dialect)
|
||||
if (!mdb_set_default_backend(mdb, insert_dialect)) {
|
||||
fputs("Invalid backend type\n", stderr);
|
||||
|
||||
Reference in New Issue
Block a user