src/data/any-reader.c (any_reader_may_open): Return tri-state value.
[pspp] / src / ui / gui / psppire.c
index 7013fcfc1ad7affdc57afaf8ca68549486297cc2..38845ed19f35535efa685e5dc81d828272511370 100644 (file)
@@ -105,11 +105,13 @@ initialize (const char *data_file)
     {
       gchar *filename = local_to_filename_encoding (data_file);
 
+      enum detect_result res = any_reader_may_open (filename);
+
       /* Check to see if the file is a .sav or a .por file.  If not
          assume that it is a syntax file */
-      if ( any_reader_may_open (filename))
-        open_data_window (NULL, filename, NULL);
-      else
+      if (res == ANY_YES)
+       open_data_window (NULL, filename, NULL);
+      else if (res == ANY_NO)
         {
           create_data_window ();
           open_syntax_window (filename, NULL);