- char *target_fn;
- char *relative_filename;
-
- /* Skip optional FILE=. */
- if (lex_match_id (lexer, "FILE"))
- lex_match (lexer, '=');
-
- /* File name can be identifier or string. */
- if (lex_token (lexer) != T_ID && lex_token (lexer) != T_STRING)
- {
- lex_error (lexer, _("expecting file name"));
- return CMD_FAILURE;
- }
-
- target_fn = ds_cstr (lex_tokstr (lexer));
-
- relative_filename =
- fn_search_path (target_fn,
- getl_include_path (lex_get_source_stream (lexer)));
-
- if ( ! relative_filename)
- {
- msg (SE, _("Can't find `%s' in include file search path."),
- target_fn);
- return CMD_FAILURE;
- }
-
- *filename = relative_filename;
- if (*filename == NULL)
- {
- msg (SE, _("Unable to open `%s': %s."),
- relative_filename, strerror (errno));
- free (relative_filename);
- return CMD_FAILURE;
- }