X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Futilities%2Finclude.c;h=0ef9d463d7393b1488dc0d768d012671dcde2b84;hb=f514231dd2fc0c2adc1ebab5c46a4b55d2bd9c2b;hp=c812c97238a9588fddf3586ed366766248372f92;hpb=2d4dd90964061defa92972156ae2a12323708519;p=pspp-builds.git diff --git a/src/language/utilities/include.c b/src/language/utilities/include.c index c812c972..0ef9d463 100644 --- a/src/language/utilities/include.c +++ b/src/language/utilities/include.c @@ -1,21 +1,18 @@ -/* PSPP - computes sample statistics. +/* PSPP - a program for statistical analysis. Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ #include #include @@ -36,6 +33,7 @@ int cmd_include (struct lexer *lexer, struct dataset *ds UNUSED) { + struct source_stream *ss; char *found_fn; char *target_fn; @@ -44,25 +42,24 @@ cmd_include (struct lexer *lexer, struct dataset *ds UNUSED) lex_match (lexer, '='); /* File name can be identifier or string. */ - if (lex_token (lexer) != T_ID && lex_token (lexer) != T_STRING) + if (lex_token (lexer) != T_ID && lex_token (lexer) != T_STRING) { - lex_error (lexer, _("expecting file name")); + lex_error (lexer, _("expecting file name")); return CMD_CASCADING_FAILURE; } target_fn = ds_cstr (lex_tokstr (lexer)); - found_fn = fn_search_path (target_fn, - getl_include_path (), - NULL); + ss = lex_get_source_stream (lexer); + found_fn = fn_search_path (target_fn, getl_include_path ( ss )); - if (found_fn != NULL) + if (found_fn != NULL) { - getl_include_source (create_syntax_file_source (found_fn)); - free (found_fn); + getl_include_source (ss, create_syntax_file_source (found_fn)); + free (found_fn); } else - msg (SE, _("Can't find `%s' in include file search path."), + msg (SE, _("Can't find `%s' in include file search path."), target_fn); lex_get (lexer);