#!/bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
-# Test Shell support: backslashed double-quotes inside single-quotes.
+# Test Shell support: backslashed double-quotes inside single-quotes
+# and ANSI-C quoting.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-sh-3.sh"
cat <<\EOF > xg-sh-3.sh
echo `gettext 'abc\"def'`
+echo `gettext $'\'\"\a\b\e\f\n\r\t\v\x61\x3a\x3A\075\\'`
EOF
-tmpfiles="$tmpfiles xg-sh-3.tmp.po xg-sh-3.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -d xg-sh-3.tmp xg-sh-3.sh
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-sh-3.tmp.po > xg-sh-3.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -d xg-sh-3.tmp xg-sh-3.sh || exit 1
+LC_ALL=C tr -d '\r' < xg-sh-3.tmp.po > xg-sh-3.po || exit 1
-tmpfiles="$tmpfiles xg-sh-3.ok"
cat <<\EOF > xg-sh-3.ok
msgid "abc\\\"def"
msgstr ""
+
+msgid ""
+"'\"\a\b\e\f\n"
+"\r\t\va::=\\"
+msgstr ""
EOF
: ${DIFF=diff}
${DIFF} xg-sh-3.ok xg-sh-3.po
result=$?
-rm -fr $tmpfiles
-
exit $result