lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix 1248 (issue3416045)


From: Carl . D . Sorensen
Subject: Fix 1248 (issue3416045)
Date: Fri, 03 Dec 2010 23:33:07 +0000

Reviewers: Neil Puttock,

Message:
Here's a proposed patch for allowing a \bookpart variable in a \book.

Description:
Fix 1248
 Change test from !scm_is_null to scm_is_pair

 Add regression test

Please review this at http://codereview.appspot.com/3416045/

Affected files:
  A input/regression/bookpart-variable.ly
  M lily/lily-parser.cc


Index: input/regression/bookpart-variable.ly
diff --git a/input/regression/bookpart-variable.ly b/input/regression/bookpart-variable.ly
new file mode 100644
index 0000000000000000000000000000000000000000..6a794e543f97b22f3cd092e3634fae29e7c747f0
--- /dev/null
+++ b/input/regression/bookpart-variable.ly
@@ -0,0 +1,19 @@
+\version "2.13.41"
+
+
+\header {
+  texidoc = "
+A @code{\bookpart} variable can be inserted in a @code{\book}.
+No segfault should occur in this case.
+"
+}
+
+mypart = \bookpart {
+  \relative c' {
+    c1
+  }
+}
+
+\book {
+  \mypart
+}
Index: lily/lily-parser.cc
diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc
index e0722fd9800fbc9167c27abaaece0151a6be709d..50267703005eade9b70daddd354e5bd5731a9766 100644
--- a/lily/lily-parser.cc
+++ b/lily/lily-parser.cc
@@ -270,7 +270,7 @@ push_paper (Lily_parser *parser, Output_def *paper)
 void
 pop_paper (Lily_parser *parser)
 {
-  if (! scm_is_null (parser->lexer_->lookup_identifier ("$papers")))
+  if (scm_is_pair (parser->lexer_->lookup_identifier ("$papers")))
     parser->lexer_->set_identifier (ly_symbol2scm ("$papers"),
scm_cdr (parser->lexer_->lookup_identifier ("$papers")));
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]