]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Add support for Shell printf format strings, part 2.
authorBruno Haible <bruno@clisp.org>
Mon, 23 Jun 2025 19:19:56 +0000 (21:19 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 23 Jun 2025 19:19:56 +0000 (21:19 +0200)
* gettext-tools/po/POTFILES.in: Add src/format-sh-printf.c.
* gettext-tools/tests/format-sh-printf-1: Use 'printf' instead of 'echo',
because 'echo' processes escape sequences on macOS, OpenBSD, Solaris.

gettext-tools/po/POTFILES.in
gettext-tools/tests/format-sh-printf-1

index 4682ec21e5ed4e6d4249d85d879a7beb47df70ef..ae89a804fc6b6f17a9e819b700d95dc12f136fa0 100644 (file)
@@ -41,6 +41,7 @@ src/format-ruby.c
 src/format-rust.c
 src/format-scheme.c
 src/format-sh.c
+src/format-sh-printf.c
 src/format-smalltalk.c
 src/format-tcl.c
 src/hostname.c
index 22486f077aeab79470a7acab4ab056a0f3463f4b..ee76814a03ecc1d8d61271f92704c6ba09652e83 100755 (executable)
@@ -145,7 +145,7 @@ while read comment; do
   n=`expr $n + 1`
   escape_backslashes='s/\\/\\\\/g'
   escape_dollars='s/\$/\\\$/g'
-  string=`echo "$string" | LC_ALL=C sed -e "$escape_backslashes" -e "$escape_dollars"`
+  string=`printf '%s\n' "$string" | LC_ALL=C sed -e "$escape_backslashes" -e "$escape_dollars"`
   cat <<EOF > f-sp-1-$n.in
 gettext ${string};
 EOF