Applied patch #5611
[pspp-builds.git] / src / language / utilities / include.c
index c812c97238a9588fddf3586ed366766248372f92..9f666747db6b99fe129ac24e7680beab3693eab1 100644 (file)
@@ -36,6 +36,7 @@
 int
 cmd_include (struct lexer *lexer, struct dataset *ds UNUSED)
 {
+  struct source_stream *ss;
   char *found_fn;
   char *target_fn;
 
@@ -52,13 +53,12 @@ cmd_include (struct lexer *lexer, struct dataset *ds UNUSED)
 
   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 ), NULL);
 
   if (found_fn != NULL) 
     {
-      getl_include_source (create_syntax_file_source (found_fn));
+      getl_include_source (ss, create_syntax_file_source (found_fn));
       free (found_fn); 
     }
   else