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

# Test the gettext program without -e option.

if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='        '
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi

# Create binary test file in correct position.
test -d gt-2 || mkdir gt-2
test -d gt-2/LC_MESSAGES || mkdir gt-2/LC_MESSAGES
cp "$abs_srcdir"/test.mo gt-2/LC_MESSAGES

: ${GETTEXT=gettext}
TEXTDOMAINDIR=. LANGUAGE=gt-2 \
${GETTEXT} --env LC_ALL=en test 'error 3' > gt-test2.out

# Create correct file.
echo $ac_n "error 3 translation$ac_c" > gtmf-test2.ok

: ${DIFF=diff}
${DIFF} gtmf-test2.ok gt-test2.out
result=$?

exit $result
