From 08fcdfc2e565f6712e549d237738345dd12d9f02 Mon Sep 17 00:00:00 2001
From: Theophile Ranquet <ranquet@lrde.epita.fr>
Date: Tue, 20 Nov 2012 10:38:45 +0000
Subject: [PATCH] maint.mk: avoid gratuitous failure

Reported by Stefano Lattarini in
<http://lists.gnu.org/archive/html/bug-bison/2012-11/msg00022.html>
* top/maint.mk (public-submodule-commit): Quote more safely.
---
 ChangeLog    | 7 +++++++
 top/maint.mk | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 348e0d5..7e5eb88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-11-20  Theophile Ranquet <ranquet@lrde.epita.fr>
+
+	maint.mk: avoid gratuitous failure
+	Reported by Stefano Lattarini in
+	<http://lists.gnu.org/archive/html/bug-bison/2012-11/msg00022.html>
+	* top/maint.mk (public-submodule-commit): Quote more safely.
+
 2012-11-17  Dmitry V. Levin  <ldv@altlinux.org>
 
 	fts: introduce FTS_VERBATIM
diff --git a/top/maint.mk b/top/maint.mk
index ea44ece..cd365e7 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -1390,8 +1390,9 @@ submodule-checks ?= no-submodule-changes public-submodule-commit
 public-submodule-commit:
 	$(AM_V_GEN)if test -d $(srcdir)/.git; then			\
 	  cd $(srcdir) &&						\
-	  git submodule --quiet foreach test '$$(git rev-parse $$sha1)'	\
-	      = '$$(git merge-base origin $$sha1)'			\
+	  git submodule --quiet foreach					\
+	      test '"$$(git rev-parse "$$sha1")"'			\
+	      = '"$$(git merge-base origin "$$sha1")"'			\
 	    || { echo '$(ME): found non-public submodule commit' >&2;	\
 		 exit 1; };						\
 	else								\
-- 
1.8.0

