From: Han-Wen Nienhuys Date: Thu, 4 Jan 2007 20:38:14 +0000 (+0100) Subject: fix -dsafe for files that switch safe-mode half way. X-Git-Tag: release/2.11.9-1~30 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c17db6fef557649f47c69ed11811231557a6179e;p=lilypond.git fix -dsafe for files that switch safe-mode half way. --- diff --git a/input/regression/safe.ly b/input/regression/safe.ly index a04b1303cd..760d60faaf 100644 --- a/input/regression/safe.ly +++ b/input/regression/safe.ly @@ -15,7 +15,7 @@ } -#(open-file "/tmp/safe-guile.scm" "r") +#(open-file "/tmp/safe-guile.scm") \include "this-should-fail.ly" diff --git a/lily/lexer.ll b/lily/lexer.ll index b89ce76cca..942c52244f 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -570,7 +570,8 @@ BOM_UTF8 \357\273\277 <*><> { if (is_main_input_) { - is_main_input_ = false; + /* 2 = init.ly + current file. */ + is_main_input_ = include_stack_.size () > 2; if (!close_input ()) /* Returns YY_NULL */ yyterminate (); diff --git a/lily/main.cc b/lily/main.cc index 7b2dfd29bb..bf8132477b 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -568,7 +568,6 @@ parse_argv (int argc, char **argv) case 's': init_scheme_variables += "(cons \'safe #t)\n"; - break; case 'p': make_preview = true;