From 38fe57357a2f46b4b2bc34f127c4e19feb694477 Mon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Date: Wed, 9 Aug 2006 10:06:37 +0000
Subject: [PATCH] * stepmake/aclocal.m4: version check patch (thanks MWD)

* ly/music-functions-init.ly: robustness. Don't crash if
currentBarNumber is not a number.
---
 ChangeLog                  | 5 +++++
 ly/declarations-init.ly    | 2 +-
 ly/music-functions-init.ly | 2 +-
 stepmake/aclocal.m4        | 2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a352e1bb5e..2e409e3ef6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-08-09  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+	* stepmake/aclocal.m4: version check patch (thanks MWD)
+
+	* ly/music-functions-init.ly: robustness. Don't crash if
+	currentBarNumber is not a number.
+
 	* VERSION (PATCH_LEVEL): bump.
 
 2006-08-08  Han-Wen Nienhuys  <hanwen@lilypond.org>
diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly
index 659629a021..4ed75b7418 100644
--- a/ly/declarations-init.ly
+++ b/ly/declarations-init.ly
@@ -109,7 +109,7 @@ partCombineListener = \layout {
     \context {
 	\Score
 	skipTypesetting = ##t
-	ignoreBarChecks = ##t 
+	ignoreBarChecks = ##t
     }
 }
 
diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index fe8453536e..7aa6dede08 100644
--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -115,7 +115,7 @@ barNumberCheck =
 	       (lambda (c)
 		 (let*
 		     ((cbn (ly:context-property c 'currentBarNumber)))
-		   (if (not (= cbn n))
+		   (if (and  (number? cbn) (not (= cbn n)))
 		       (ly:input-message location "Barcheck failed got ~a expect ~a"
 					 cbn n))))))
 
diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4
index 96959c09f7..813b830977 100644
--- a/stepmake/aclocal.m4
+++ b/stepmake/aclocal.m4
@@ -32,7 +32,7 @@ AC_DEFUN(STEPMAKE_GET_VERSION, [
     ## for compatibility reasons.
     
     ## grab the first version number in  --version output.
-    eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep ' [0-9][0-9]*\.[0-9]' \
+    eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '\(^\| \)[0-9][0-9]*\.[0-9]' \
         | head -n 1 \
 	| tr ' ' '\n' | grep '[0-9]\.[0-9]' | head -n 1 | sed 's/\([0-9.]*\).*/\1/g'\`\"
 
-- 
2.39.5