]> git.donarmstrong.com Git - lilypond.git/commitdiff
(insert_tweak_from_file): dubious
authorhanwen <hanwen>
Sat, 30 Apr 2005 22:42:54 +0000 (22:42 +0000)
committerhanwen <hanwen>
Sat, 30 Apr 2005 22:42:54 +0000 (22:42 +0000)
bugfix. Make sure that 0x0 isn't passed into scm_cons(). Fixes
crash with tweak editor.

ChangeLog
lily/parser.yy
lily/tweak-registration.cc
scm/lily.scm

index c7b55c0c149304a5619e30530e9b623d6eb01450..d302f7d9f46c51187f72ad88e25893f758bde8ad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-01  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/tweak-registration.cc (insert_tweak_from_file): dubious
+       bugfix. Make sure that 0x0 isn't passed into scm_cons(). Fixes
+       crash with tweak editor.
+
 2005-04-30  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * lily/part-combine-engraver.cc: add space to variable list.
index 1ff26ea6e5785ded4ff4a1f6cd2b081151ab5ecb..db3f0ce8f9b20e0dfb07c844d1dada273f7d6846 100644 (file)
@@ -2573,7 +2573,7 @@ markup_braced_list:
        ;
 
 markup_braced_list_body:
-       /* empty */     {  $$ = scm_list (SCM_EOL); }
+       /* empty */     {  $$ = SCM_EOL; }
        | markup_braced_list_body markup {
                $$ = scm_cons ($2, $1);
        }
@@ -2647,7 +2647,8 @@ simple_markup:
        
 markup:
        markup_head_1_list simple_markup        {
-               $$ = scm_car (scm_call_2 (ly_lily_module_constant ("map-markup-command-list"), $1, scm_list_1 ($2)));
+               SCM mapper = ly_lily_module_constant ("map-markup-command-list");
+               $$ = scm_car (scm_call_2 (mapper, $1, scm_list_1 ($2)));
        }
        | simple_markup {
                $$ = $1;
index fe815e19c85e86fa927cd1db328b7a1ff5a1f5b2..9604c5f202bde81dd60e7e7a6a7917e3f4d301fa 100644 (file)
@@ -42,10 +42,13 @@ Tweak_registry::insert_tweak_from_file (SCM tweak)
          && scm_car (skey) == ly_symbol2scm ("key"));
 
   Object_key const *key = undumper_->get_key (scm_to_int (scm_cadr (skey)));
-  if (tweaks_.find (key) == tweaks_.end ())
-    tweaks_[key] = SCM_EOL;
 
-  tweaks_[key] = scm_cons (scm_cdr (tweak), tweaks_[key]);
+  SCM existing = SCM_EOL;
+  Tweak_map::const_iterator prev = tweaks_.find (key);
+  if (prev != tweaks_.end ())
+    existing = (*prev).second;
+
+  tweaks_[key] = scm_cons (scm_cdr (tweak), existing);
 }
 
 void
index 02a6671ac97272231cb5315cfd6c59b8754c53e9..9a0b1dfb605034a4a6d53c08796c8eccb63bc5b2 100644 (file)
@@ -9,7 +9,7 @@
 (if (defined? 'set-debug-cell-accesses!)
     (set-debug-cell-accesses! #f))
 
-;;(set-debug-cell-accesses! 5000)
+;(set-debug-cell-accesses! 1000)
 
 (use-modules (ice-9 regex)
             (ice-9 safe)