+ lex_error (lexer, _("expecting file name"));
+ return CMD_FAILURE;
+ }
+
+ relative_name = utf8_to_filename (lex_tokcstr (lexer));
+ filename = include_path_search (relative_name);
+ free (relative_name);
+
+ if ( ! filename)
+ {
+ msg (SE, _("Can't find `%s' in include file search path."),
+ lex_tokcstr (lexer));
+ return CMD_FAILURE;
+ }
+ lex_get (lexer);
+
+ syntax_mode = LEX_SYNTAX_INTERACTIVE;
+ error_mode = LEX_ERROR_CONTINUE;
+ cd = false;
+ status = CMD_FAILURE;
+ encoding = xstrdup (dataset_get_default_syntax_encoding (ds));
+ while ( T_ENDCMD != lex_token (lexer))
+ {
+ if (lex_match_id (lexer, "ENCODING"))
+ {
+ lex_match (lexer, T_EQUALS);
+ if (!lex_force_string (lexer))
+ goto exit;
+
+ free (encoding);
+ encoding = xstrdup (lex_tokcstr (lexer));
+ }
+ else if (variant == INSERT && lex_match_id (lexer, "SYNTAX"))
+ {
+ lex_match (lexer, T_EQUALS);
+ if ( lex_match_id (lexer, "INTERACTIVE") )
+ syntax_mode = LEX_SYNTAX_INTERACTIVE;
+ else if ( lex_match_id (lexer, "BATCH"))
+ syntax_mode = LEX_SYNTAX_BATCH;
+ else if ( lex_match_id (lexer, "AUTO"))
+ syntax_mode = LEX_SYNTAX_AUTO;
+ else
+ {
+ lex_error (lexer, _("expecting %s, %s, or %s after %s"),
+ "BATCH", "INTERACTIVE", "AUTO", "SYNTAX");
+ goto exit;
+ }
+ }
+ else if (variant == INSERT && lex_match_id (lexer, "CD"))
+ {
+ lex_match (lexer, T_EQUALS);
+ if ( lex_match_id (lexer, "YES") )
+ {
+ cd = true;
+ }
+ else if ( lex_match_id (lexer, "NO"))
+ {
+ cd = false;
+ }
+ else
+ {
+ lex_error (lexer, _("expecting %s or %s after %s"),
+ "YES", "NO", "CD");
+ goto exit;
+ }
+ }
+ else if (variant == INSERT && lex_match_id (lexer, "ERROR"))
+ {
+ lex_match (lexer, T_EQUALS);
+ if ( lex_match_id (lexer, "CONTINUE") )
+ {
+ error_mode = LEX_ERROR_CONTINUE;
+ }
+ else if ( lex_match_id (lexer, "STOP"))
+ {
+ error_mode = LEX_ERROR_STOP;
+ }
+ else
+ {
+ lex_error (lexer, _("expecting %s or %s after %s"),
+ "CONTINUE", "STOP", "ERROR");
+ goto exit;
+ }
+ }
+
+ else
+ {
+ lex_error (lexer, NULL);
+ goto exit;
+ }