From: Ben Pfaff Date: Sun, 22 Dec 2013 07:14:19 +0000 (-0800) Subject: pspp-convert: Use null encoding rather than "Auto" by default. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7ba9eb594b356de8df09b4e5ed59d40898c726a;p=pspp 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. --- 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);