]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-lexer.cc
axis-group-interface.cc: coding style nit
[lilypond.git] / lily / lily-lexer.cc
index 8d70783cb5989da22c5eede795ac94bcf6f72cc3..cd0c42eaa4eedf910386703de34a975ffaf43909 100644 (file)
@@ -231,14 +231,29 @@ Lily_lexer::start_main_input ()
   
   new_input (main_input_name_, sources_);
 
-  /* Do not allow \include in --safe-mode */
-  allow_includes_b_ = allow_includes_b_ && !be_safe_global;
-
   scm_module_define (scm_car (scopes_),
                     ly_symbol2scm ("input-file-name"),
                     scm_makfrom0str (main_input_name_.c_str ()));
 }
 
+void
+Lily_lexer::new_input (string str, string d, Sources *ss)
+{
+  Includable_lexer::new_input (str, d, ss);
+}
+
+void
+Lily_lexer::new_input (string str, Sources *ss)
+{
+  if (is_main_input_ && be_safe_global)
+    {
+      LexerError (_ ("include files are not allowed in safe mode").c_str ());
+      return;
+    }
+
+  Includable_lexer::new_input (str, ss);
+}
+
 void
 Lily_lexer::set_identifier (SCM name, SCM s)
 {