From fe13b596d06af550bc2f92dd0e39a9c794230b03 Mon Sep 17 00:00:00 2001
From: Peter Williams <peter@newton.cx>
Date: Mon, 3 Sep 2018 17:36:09 -0400
Subject: [PATCH 4/9] Fix quoting when invoking "windres"

Version strings were being quoted too much. I'm not sure why this wasn't a
problem elsewhere, but it's definitely a problem on Windows.
---
 gettext-runtime/intl/Makefile.in       | 4 ++--
 gettext-runtime/src/Makefile.am        | 2 +-
 gettext-tools/libgettextpo/Makefile.am | 2 +-
 gettext-tools/src/Makefile.am          | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in
index 377ca58..9724493 100644
--- a/gettext-runtime/intl/Makefile.in
+++ b/gettext-runtime/intl/Makefile.in
@@ -330,7 +330,7 @@ libintl.res.o: $(srcdir)/libintl.rc
 	sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
 	sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
 	$(WINDRES) \
-	  "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \
+	  "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \
 	  "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \
 	  "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \
 	  "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \
@@ -341,7 +341,7 @@ libintl.res.lo: $(srcdir)/libintl.rc
 	sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
 	sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
 	$(LIBTOOL) --mode=compile --tag=RC $(RC) \
-	  "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \
+	  "-DPACKAGE_VERSION_STRING=\"$(VERSION)\"" \
 	  "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \
 	  "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \
 	  "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \
diff --git a/gettext-runtime/src/Makefile.am b/gettext-runtime/src/Makefile.am
index bf765a5..94a1f21 100644
--- a/gettext-runtime/src/Makefile.am
+++ b/gettext-runtime/src/Makefile.am
@@ -68,7 +68,7 @@ RELOCATABLE_STRIP = :
 if WOE32
 WOE32_LDADD = gettext.res
 gettext.res : $(top_srcdir)/../windows/gettext.rc
-	$(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options --escape $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff
+	$(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff
 MOSTLYCLEANFILES += gettext.res
 else
 WOE32_LDADD =
diff --git a/gettext-tools/libgettextpo/Makefile.am b/gettext-tools/libgettextpo/Makefile.am
index 36bd700..e533682 100644
--- a/gettext-tools/libgettextpo/Makefile.am
+++ b/gettext-tools/libgettextpo/Makefile.am
@@ -127,7 +127,7 @@ EXTRA_DIST += libgettextpo.rc
 if WOE32
 WOE32_LIBADD = libgettextpo.res.lo
 libgettextpo.res.lo : $(srcdir)/libgettextpo.rc
-	$(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) `$(SHELL) $(top_srcdir)/../windows/windres-options --escape $(VERSION)` -i $(srcdir)/libgettextpo.rc -o libgettextpo.res.lo --output-format=coff
+	$(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) `$(SHELL) $(top_srcdir)/../windows/windres-options $(VERSION)` -i $(srcdir)/libgettextpo.rc -o libgettextpo.res.lo --output-format=coff
 MOSTLYCLEANFILES += libgettextpo.res.lo
 else
 WOE32_LIBADD =
diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am
index 0538d1e..35a7a6e 100644
--- a/gettext-tools/src/Makefile.am
+++ b/gettext-tools/src/Makefile.am
@@ -630,7 +630,7 @@ RELOCATABLE_STRIP = :
 if WOE32
 WOE32_LDADD = gettext.res
 gettext.res : $(top_srcdir)/../windows/gettext.rc
-	$(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options --escape $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff
+	$(WINDRES) `$(SHELL) $(top_srcdir)/../windows/windres-options $(VERSION)` -i $(top_srcdir)/../windows/gettext.rc -o gettext.res --output-format=coff
 MOSTLYCLEANFILES += gettext.res
 else
 WOE32_LDADD =
-- 
2.17.1

