From f7ba9eb594b356de8df09b4e5ed59d40898c726a Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 21 Dec 2013 23:14:19 -0800 Subject: [PATCH] pspp-convert: Use null encoding rather than "Auto" by default. This avoids errors trying to create a converter to and from a nonexistent "Auto" encoding. --- utilities/pspp-convert.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utilities/pspp-convert.c b/utilities/pspp-convert.c index 233bfbffbf..61e346d124 100644 --- a/utilities/pspp-convert.c +++ b/utilities/pspp-convert.c @@ -47,11 +47,11 @@ main (int argc, char *argv[]) const char *input_filename; const char *output_filename; - struct fh_properties properties; long long int max_cases = LLONG_MAX; struct dictionary *dict; struct casereader *reader; struct file_handle *input_fh; + const char *encoding = NULL; const char *output_format = NULL; struct file_handle *output_fh; @@ -64,7 +64,6 @@ main (int argc, char *argv[]) fh_init (); settings_init (); - properties = *fh_default_properties (); for (;;) { static const struct option long_options[] = @@ -92,7 +91,7 @@ main (int argc, char *argv[]) break; case 'e': - properties.encoding = optarg; + encoding = optarg; break; case 'O': @@ -129,8 +128,8 @@ main (int argc, char *argv[]) output_format = dot + 1; } - input_fh = fh_create_file (NULL, input_filename, &properties); - reader = any_reader_open (input_fh, properties.encoding, &dict); + input_fh = fh_create_file (NULL, input_filename, fh_default_properties ()); + reader = any_reader_open (input_fh, encoding, &dict); if (reader == NULL) exit (1); -- 2.30.2