#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test C support: --trigraphs option.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-c-4.in.c"
cat <<EOF > xg-c-4.in.c
-main()??<printf(gettext("Hello, " "World!" "??/n")); ??>
+main()??<printf(gettext("Hello, " "World!" "??/n"));return 0 ? a??(0??'1??) : 1??!??-a[0]??#1;????>
EOF
-tmpfiles="$tmpfiles xg-c-4.tmp.po xg-c-4.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location --trigraphs -d xg-c-4.tmp xg-c-4.in.c
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-c-4.tmp.po > xg-c-4.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location --trigraphs -d xg-c-4.tmp xg-c-4.in.c || exit 1
+LC_ALL=C tr -d '\r' < xg-c-4.tmp.po > xg-c-4.po || exit 1
-tmpfiles="$tmpfiles xg-c-4.ok"
cat <<EOF > xg-c-4.ok
#, c-format
msgid "Hello, World!\n"
${DIFF} xg-c-4.ok xg-c-4.po
result=$?
-rm -fr $tmpfiles
-
exit $result