Hello there,

when 'gnulib-tool' is listing modules in bold type,
it does so in a non-portable way. FreeBSD displays
this failure, since its printf(1) is not accepting
hexadecimally encoded characters. In fact, the POSIX
manual page printf(1p) mentions octal encoding as
the only valid mechanism. Patch follows.

Best regards,
  Mats Erik Andersson
>From f1d4b29b460307d0e96b12ce4f3fce9fb86cfd9c Mon Sep 17 00:00:00 2001
From: Mats Erik Andersson <g...@gisladisker.se>
Date: Wed, 15 Apr 2015 18:31:46 +0200
Subject: [PATCH] gnulib-tool: use bold font portably

* gnulib-tool (func_show_module_list): Change hexadecimal
numbers to octal in BOLD_ON and BOLD_OFF.  The use of hex
encoded numbers as arguments to `printf' is not portable,
and is not claimed by POSIX.  This is the case with FreeBSD.
---
 ChangeLog   |    8 ++++++++
 gnulib-tool |    4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 95d49ec..ba811e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-04-15  Mats Erik Andersson  <g...@gisladisker.se>  (tiny change)
+
+	gnulib-tool: use bold font portably
+	* gnulib-tool (func_show_module_list): Change hexadecimal
+	numbers to octal in BOLD_ON and BOLD_OFF.  The use of hex
+	encoded numbers as arguments to `printf' is not portable,
+	and is not claimed by POSIX.  This is the case with FreeBSD.
+
 2015-04-14  Ángel González  <keis...@gmail.com>
 
 	tempname: avoid unused parameter warnings (trivial)
diff --git a/gnulib-tool b/gnulib-tool
index eb1e5a2..303df53 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -2803,8 +2803,8 @@ func_show_module_list ()
        *) false;;
      esac; then
     # Assume xterm compatible escape sequences.
-    bold_on=`printf '\x1b[1m'`
-    bold_off=`printf '\x1b[0m'`
+    bold_on=`printf '\033[1m'`
+    bold_off=`printf '\033[0m'`
   else
     bold_on=
     bold_off=
-- 
1.7.3.2

Reply via email to