From: Bruno Haible Date: Mon, 23 Jun 2025 19:19:56 +0000 (+0200) Subject: Add support for Shell printf format strings, part 2. X-Git-Tag: v0.26~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6373812d7f122c60df298a9bac8a86ee9553179;p=thirdparty%2Fgettext.git Add support for Shell printf format strings, part 2. * 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. --- diff --git a/gettext-tools/po/POTFILES.in b/gettext-tools/po/POTFILES.in index 4682ec21e..ae89a804f 100644 --- a/gettext-tools/po/POTFILES.in +++ b/gettext-tools/po/POTFILES.in @@ -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 diff --git a/gettext-tools/tests/format-sh-printf-1 b/gettext-tools/tests/format-sh-printf-1 index 22486f077..ee76814a0 100755 --- a/gettext-tools/tests/format-sh-printf-1 +++ b/gettext-tools/tests/format-sh-printf-1 @@ -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 < f-sp-1-$n.in gettext ${string}; EOF