#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test C support: comments.

cat <<EOF > xg-c-5.in.cc
main(){printf(gettext/*puke*/(/*barf*/"Hello, " "World!" "\n")); }
EOF

: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --add-comments -d xg-c-5.tmp xg-c-5.in.cc || Exit 1
LC_ALL=C tr -d '\r' < xg-c-5.tmp.po > xg-c-5.po || Exit 1

cat <<EOF > xg-c-5.ok
#. puke
#. barf
#, c-format
msgid "Hello, World!\n"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-c-5.ok xg-c-5.po
result=$?

exit $result
