[PATCH libgpg-error] build: Remove literal "\c" strings from lock-obj-pub.native.h

David Michael fedora.dm0 at gmail.com
Thu Mar 25 23:05:05 CET 2021


* src/gen-lock-obj.sh: Capture echo output with quotes.

--

Cross-compiling produces a gpg-error.h with instances of "\c"
everywhere which breaks compilation due to invalid syntax.  It is
caused by the "echo -n" test having no output, which was not
captured as an empty token due to not being quoted.  That meant the
"test" command was operating on only the "-n" argument.

Signed-off-by: David Michael <fedora.dm0 at gmail.com>
---

(resending since it doesn't look like this was delivered to the list)

Hi,

Can something like this be applied to fix cross-compiling 1.42?  You can
try it with commands like this:

/bin/sh -c 'test -n `echo -n` ; echo $?'
/bin/sh -c 'test -n "`echo -n`" ; echo $?'

Thanks.

David

 src/gen-lock-obj.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh
index a710f0c..258eec6 100755
--- a/src/gen-lock-obj.sh
+++ b/src/gen-lock-obj.sh
@@ -38,7 +38,7 @@
 #     AWK=gawk ./gen-lock-obj.sh
 #
 
-if test -n `echo -n`; then
+if test -n "`echo -n`"; then
     ECHO_C='\c'
     ECHO_N=''
 else
-- 
2.26.3



More information about the Gnupg-devel mailing list