FACTOR: Avoid assertion failures on syntax errors expecting numbers.
[pspp] / src / language / data-io / file-handle.q
index 313adc952b8bdcf14190c6186924bc0a43394897..7ac20a080c8ae063f2d9d797bd1f0d8f35ae9d27 100644 (file)
@@ -72,8 +72,8 @@ cmd_file_handle (struct lexer *lexer, struct dataset *ds)
   if (handle != NULL)
     {
       msg (SE, _("File handle %s is already defined.  "
-                 "Use CLOSE FILE HANDLE before redefining a file handle."),
-          handle_name);
+                 "Use %s before redefining a file handle."),
+          handle_name, "CLOSE FILE HANDLE");
       goto exit_free_handle_name;
     }
 
@@ -132,7 +132,7 @@ cmd_file_handle (struct lexer *lexer, struct dataset *ds)
         }
       else
         {
-          msg (SE, _("RECFORM must be specified with MODE=360."));
+          msg (SE, _("%s must be specified with %s."), "RECFORM", "MODE=360");
           goto exit_free_cmd;
         }
       break;
@@ -157,7 +157,7 @@ cmd_file_handle (struct lexer *lexer, struct dataset *ds)
   if (cmd.s_encoding != NULL)
     properties.encoding = cmd.s_encoding;
 
-  fh_create_file (handle_name, cmd.s_name, &properties);
+  fh_create_file (handle_name, cmd.s_name, lex_get_encoding (lexer), &properties);
 
   result = CMD_SUCCESS;
 
@@ -249,7 +249,7 @@ fh_parse (struct lexer *lexer, enum fh_referent referent_mask,
       if (lex_token (lexer) == T_ID)
         handle = fh_from_id (lex_tokcstr (lexer));
       if (handle == NULL)
-            handle = fh_create_file (NULL, lex_tokcstr (lexer),
+       handle = fh_create_file (NULL, lex_tokcstr (lexer), lex_get_encoding (lexer),
                                      fh_default_properties ());
       lex_get (lexer);
     }